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

How do you use loops correctly to check players on a team?

Basically, I want this script to constantly check the count of the blue team's players until it's 0and then I want to execute a script.

I don't know how to loop it..

if #game.Teams.Runner:GetPlayers() == 0 then
--do stuff
end

1 answer

In this case you would use a While loop which is basically an if statement, but While something is equal to something or true, it will play the loop until it's not equal or false

in this case you can do

while #game.Teams.Runner:GetPlayers() > 0 do
	-- Whatever you want in here
end

The wiki has some information on the types of loops and how they work here http://wiki.roblox.com/?title=Loops

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