**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
**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
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 :)
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)
and if the team is not empty ?
If it's not empty, the function will return false, otherwise will return true
and if i want make a button invisible when team is full, how can i do ?
thanks you everyone for Helping !
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
can i put in a "While true do"