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

Could you respawn players using "GetChildren()" on a Server Script?

I'm trying to make code where it will spawn all players at once, but i'm kind of a noob to for-loops and i'm using a server script.

here's my (sort of) code:

function wavespawn() 
for _,v in pairs(game.Players:GetChildren()) do
	v:LoadCharacter()
end
end

it's not done, so anything that could help would be good. Thanks!

1 answer

✓ Accepted answer

Try to refrain from using GetChildren() whilst calling players on certain situations, this should work regardless.

function wavespawn()
	for _,v in pairs(game.Players:GetPlayers()) do
		v:LoadCharacter()
	end
end

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