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

when making a script how would I tell if no one is on a certain team??

I'm trying to make a script that gets executed/functions when there is no one on a certain team but how would I tell if there is no one on the team?

Sorry I checked everywhere and I couldn't find a tutorial on how to do this and I dont know alot of stuff about these kinds of scripts so pleas help :)

2 comments

0

Include your code

0

I dont have a clue on how to start this script

1 answer

You could use the GetPlayers function of a Team object to return a table of all the players. You then compare that number to 0 to see if anyone is on the team.

if #Team:GetPlayers() == 0 then
	-- ok
end

2 comments

0

wat?

0

A team is an instance and it would be a child of the Teams service. You can define the team by finding it in there.

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