I am making a meteor game and I have a script that is supposed to randomly spawn in my meteor models but it only spawn in two meteors and gives me an error here is the error:
"invalid argument #2 to 'random' (interval is empty)" And I don't know how to fix it here is my script:
while wait(1) do
local pos1 = math.random(-1486,1486)
local pos2 = math.random(-1486,1486)
local folder = game.ReplicatedStorage.Meteors:GetChildren()
local meteors = folder[math.random(1, #folder)]
meteors.Parent = game.Workspace.InGameMeteors
meteors.Position = Vector3.new(pos1, 100, pos2)
end

2 comments
That means there's nothing inside of the folder
Thanks