Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to reset all players in a server?

I'm making a game with rounds, and at the end of each round all players are reset and then sent back to the lobby. My code below isn't resetting all players and I don't know what is wrong.

local playerstoreset = game.Players:GetChildren() for i = 1, #playerstoreset do if playerstoreset[i]:WaitForChild("Character") ~= nil then playerstoreset[i]:WaitForChild("Character").Humanoid.Health = 0

2 answers

✓ Accepted answer
for i,v in pairs(game.Players:GetPlayers()) do
v.Character.Humanoid.Health = 0
end

This discussion is preserved as it was. New answers, comments, and votes are closed.