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

Does anyone know how keep checking if all players are not on a team?

Just wanted to make a round based game a bit less annoying. I want to make it keep checking again and again, so I can know when to end the round when ALL of the players are NOT on on a team AT THE SAME TIME. Could someone give me an example script so I can understand this a little bit better?

6 comments

0

so you want to check if all players arent on a certain team

0

yes

0

you could use a for i,v in pairs loop and use the variable to check if there on a certain team

0

but I want it to check if all players are not on a team AT ONCE

0

thats what it does ;-;

0

for _,v in pairs() do

1 answer

✓ Accepted answer

You can use a for i do loop:

local Players = game.Players:GetPlayers()

for i = 1, #Players do 
	local player = Players[i]
	if player.Team then 
		print(player.Name .. " has a team.")
	else
		print(plauer.Name .. " doesn't have a team.")
	end
end

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