Why is my meteor spawn script not working and not giving me an error?
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:
2 | local pos 1 = math.random(- 1486 , 1486 ) |
3 | local pos 2 = math.random(- 1486 , 1486 ) |
5 | local folder = game.ReplicatedStorage.Meteors:GetChildren() |
6 | local meteors = folder [ math.random( 1 , #folder) ] |
7 | meteors.Parent = game.Workspace.InGameMeteors |
8 | meteors.Position = Vector 3. new(pos 1 , 100 , pos 2 ) |