--[[
Settings for terrian generation
]]
local Maxheight = 10
local Minheight = -10
--[[
Varibles
]]
local GenerationInProgress = false
local TerrianGenerationFinished = false
local IsChunkLoading = false
local TerrianFolder = workspace.TerrianF
local Chunks = TerrianFolder.Chunks
function StartGeneration()
if GenerationInProgress == false and TerrianGenerationFinished == false then
GenerationInProgress = true
LoadChunk()
warn("Started Loading Chunk")
else
warn("Error Code 0/01")
end
end
function LoadChunk()
if IsChunkLoading == false then
ChunkLoop()
else
warn("Error Code 0/02")
end
end
function ChunkLoop()
for i,v in pairs(Chunks:GetChildren()) do
if v.IsLoaded.Value == false then
IsChunkLoading = true
NodeLoop(v)
else
warn("Error 0/03")
end
end
end
function NodeLoop(v)
for i,n in pairs(v.Nodes:GetChildren()) do
n.Position = Vector3.new(0,math.random(Maxheight,Minheight),0)
warn("Set Nodes i guess?")
end
end
StartGeneration()
My error is ServerScriptService.Script:51: invalid argument #2 to 'random' (interval is empty) witch is in the nodeloop function

1 comment
hey math.random(minheight,maxheight) not math.random(maxheight,minheight) Remember thank, goodbye.