Template:TerrainBuilder3DRbxBlockScript

-- TerrainBuilder 3D BlockScript -- Load RbxLibraries local RbxGui = assert(LoadLibrary('RbxGui')) local RbxUtility = assert(LoadLibrary('RbxUtility')) -- local RbxStatus = assert(LoadLibrary('RbxStatus')) local RbxGear = assert(LoadLibrary('RbxGear')) local RbxStamper = assert(LoadLibrary('RbxStamper')) -- Done Loading RbxLibraries

local World = Workspace:FindFirstChild("World") local Model = script.Parent local IsPowered = Model.IsPowered

-- Wait for ComputerServer to finish setting up. while _G["ComputerServerReady"] == nil do  wait(1) end

function NewStone local Grass = { ["ID"] = 1, ["DataValue"] = 0 }  return Grass end

function NewDirt local Grass = { ["ID"] = 2, ["DataValue"] = 0 }  return Grass end

function NewGrass local Grass = { ["ID"] = 2, ["DataValue"] = 15 }  return Grass end

-- Generate Chunks -- Prints table contents. function PrintTable(t) for key,value in pairs(t) do     print(key,value) end end local PrintTable = PrintTable

-- Returns the name of the block Id. function BIDN(ID) return TableBlockName[ID] end

-- Prints table contents using a table refrence. function PrintTableVRef(Table,Ref) print("Table "..tostring(Table)) for key,value in pairs(Table) do     print(key, BIDN(value)) end end local PrintTableVRef = PrintTableVRef

-- Print Block function PrintBlock(TableChunk, TableBlock) PrintTableVRef(value, TableBlockName) print("Block "..key) end local PrintBlock = PrintBlock

--Print the chunk function PrintTChunk(Table) print("Chunk "..tostring(Table)) for YKey, YValue in pairs(Table) do     print("Block Y: ".. YKey, YValue) for XKey, XValue in pairs(Table) do        print("Block X: "..XKey,XValue) for ZKey, ZValue in pairs(Table) do           print("Block Z: "..ZKey,ZValue) print("ID: " .. (Table[YKey][XKey][ZKey]["ID"]) .. " Name: " .. BIDN((Table[YKey][XKey][ZKey]["ID"]))) end end end end local PrintTChunk = PrintTChunk

-- Actual Function used to print a chunk function PrintChunk(x, y, z)  PrintTChunk(ChunkTable[y][x][z]) end

-- Returns TableBlock in Chunk using TableChunk, X, Y, and Z. function GetBlockChunk(TableChunk,BX,BY,BZ) return TableChunk[BY][BX][BZ] end

local TableBlockName = TableBlockName local TableBlockTexture = TableBlockTexture

--