I need to check if there is no players on a team but I cant find a method to do so.
Try this:
function getPlayerNumberInTeam(TeamColor) local num = 0 for index,player in pairs(game.Players:GetChildren()) do if player.TeamColor == TeamColor and not player.Neutral then num = num+1 end end return num end print(getPlayerNumberInTeam(game.Teams.Team.TeamColor))