This script won't work and won't give off any errors, I used prints and it errors at the for loop????
01 | s = game.Workspace.Spawns.StartingPlace |
02 | p = game.Players:GetChildren() |
03 |
04 | while true do |
05 | wait( 10 ) |
06 | for i = 1 , #p do --Where the print didn't continue |
07 | script.Parent.NumberOfPeopleInGame.Value = #p |
08 | if game.Workspace:findFirstChild(p [ i ] .Name) then |
09 | p [ i ] .Character.Torso.CFrame = s.CFrame * CFrame.new(math.random(- 3 , 3 ), 8 ,math.random(- 3 , 3 )) |
10 | end |
11 | end |
12 | end |
I'm not sure when you're running the code, but your 'p' value will never update if it's not in the loop. At the start of the game, your '#p' will be 0, and thus, you won't run the loop. However, if you tried running it again whilst in-server and it didn't work, then I haven't a clue why.