local X = 50 local Z = 50 local Y = 1 local grid = {} for x = 1, X do grid[x] = {} for y = 1, Y do grid[x][y] = {} for z = 1, Z do grid[x][y][z] = math.noise(x/10, z/10) * 15 end end end for x = 1, X do for z = 1, Z do for y = 1,Y do local yPos = grid[x][y][z] local part = Instance.new("Part") part.Anchored = true part.Material = Enum.Material.Grass part.BrickColor = BrickColor.new("Earth green") part.Position = Vector3.new(x*3, yPos, z*3) -- Makes The Block Not Snap To Grid The yPos Is The Problem I Think part.Size = Vector3.new(3, 3, 3) part.Parent = workspace.TerrainFolder end end end
Answered
local X = 30 local Z = 30 local Y = 5 local function STG(X) return math.floor(X / 3 + 0.5) * 3 end local grid = {} for x = 1, X do grid[x] = {} for y = 1, Y do grid[x][y] = {} for z = 1, Z do grid[x][y][z] = math.noise(x/10 ,y/10,z/10) * 15 end end end for x = 1, X do for z = 1, Z do for y = 1,Y do local yPos = grid[x][y][z] local part = Instance.new("Part") part.Anchored = true part.Material = Enum.Material.Grass part.BrickColor = BrickColor.new("Earth green") part.Position = Vector3.new(x*3, STG(yPos), z*3) part.Size = Vector3.new(3, 3, 3) part.Parent = workspace.Twerrain end end end