**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 :
1 | Site Director |
1 | if #game:GetService( "Teams" ):FindFirstChild( "Site Director" ):GetPlayers() = = 0 |
2 | then print ( "EMPTY" ) |
3 | else print ( "NOT EMPTY" ) |
4 | 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
1 | local function IsTeamEmpty(team) |
2 | return #team:GetPlayers() = = 0 |
3 | end |
4 |
5 | local isEmpty = IsTeamEmpty(game:GetService( "Teams" ):FindFirstChild( "Site Director" )) |
6 | print (isEmpty) |