In my game, all players respawn after each round, using this loop
for i,v in pairs(game.Players:GetChildren()) do if v:IsA('Player') then if v.Character ~= nil then v:LoadCharacter() end end end
While it almost always works flawlessly, on rare occasions this section of the script just seems to freeze. I don't get any errors, but the script doesn't move on after this point, and I know this because the script has a print before and after this loop.
Is there a better way of doing this so it always works? Am I doing something wrong?
Thanks for any help
for _,v in pairs(game:GetService("Players"):GetPlayers()) do --no need to check if its a player v:LoadCharacter() end