I am working on a game that teleports all players to a sort of lobby, after a set time I want all the players to respawn, like from admin commands where it does not go through the death wait
✓ ANSWER ACCEPTED
How to respawn all players?
2 answers
✓ Accepted answer
for num,player in pairs(game.Players:GetPlayers()) do
player:LoadCharacter()
end
Make sure you have this inside a (Server) Script and not a LocalScript as you can only call LoadCharacter from a server sided script.
Try this script:
while wait() do
wait(5) -- edit the "5" to whatever you'd like (seconds)
for i,v in ipairs(game.Players:GetChildren()) do
v:LoadCharacter()
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
