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

Know if a team is empty or not ?

**hello everyone **

I would like to know how to make a script that detects if a team is empty or not (team name: Site Director) thanks for helping!

team name :

Site Director

3 answers

✓ Accepted answer
if #game:GetService("Teams"):FindFirstChild("Site Director"):GetPlayers() == 0
	then print("EMPTY")
else print("NOT EMPTY")
end

or you can wrap it in a function and call it whenever ya want :)

1 comment

0

can i put in a "While true do"

You can check the length of Team:GetPlayers() and compare it to 0

local function IsTeamEmpty(team)
	return #team:GetPlayers() == 0
end

local isEmpty = IsTeamEmpty(game:GetService("Teams"):FindFirstChild("Site Director"))
print(isEmpty)

3 comments

0

and if the team is not empty ?

0

If it's not empty, the function will return false, otherwise will return true

0

and if i want make a button invisible when team is full, how can i do ?

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