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

How do I make a script sort through a table?

I'm making a game and I have a table.insert() script that includes all the current players in the player service. I want each player to take turns separately but other players to watch[I have the watch script in place], so in order of the table it will give them their turn and I already have a table.remove() script for when they finish their turn. I just would like to know how to make it so that players take turns in the table for their order,

Help is appreciated, Links would be great to find out about this.

1 answer

✓ Accepted answer

This might help

for num,Obj in pairs(game.Players:GetChildren()) do
	-- do stuff for each 
end

or

for num,Obj in pairs(game.Players:GetPlayers()) do
	-- do stuff for each 
end

1 comment

0

Thanks!

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