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

how can you create a small block of code that respawns all players?

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?

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.

1 comment

0

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

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