I am making a training center for my group and when i load a map i want it to respawn all player but i dont know how could someone help?
✓ ANSWER ACCEPTED
how can you create a small block of code that respawns all players?
2 answers
✓ Accepted answer
This script needs to be in a Regular server-side http://wiki.roblox.com/index.php?title=Script.
Use :LoadCharacter() to respawn the players. You can also do :LoadCharacter(false) or :LoadCharacter(true). :LoadCharacter(true) respawns them normally and :LoadCharacter() and :LoadCharacter(true) is the same thing. :LoadCharacter(false) respawns the player but lets say you change their CharacterAppearence then :LoadCharacter(false), the CharacterAppearence doesn't apply to them.
for _, player in pairs(game.Players:GetPlayers()) do
if player.Character then --Checks to see if the player is a legit one.
player:LoadCharacter() --Respawns player
end
end
for _,v in pairs(game.Players:GetPlayers()) do
v:LoadCharacter()
end
That snippet should do it.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Please explain how it works because gavnnater45 won't understand how it works.