|
| 03 Apr 2013 03:21 AM |
I want to perform an action if no players are on a team. I tried this, but as soon as one player changes team it performs the action. How do I only perform the reaction if no one is on the team?
while wait() do for _,plr in next,game.Players:GetPlayers() do if plr.TeamColor ~= BrickColor.new("White") then --do stuff end end end
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 03 Apr 2013 05:10 AM |
function GetPlayers(Team) local Players = game.Players:GetChildren() local PCount = 0 for i=1,#Players do if Players[i].TeamColor == Team.TeamColor then PCount = PCount + 1 end end return PCount end
local People = GetPlayers(game.Teams["Team Name"]) -- Returns players on team print( People ) |
|
|
| Report Abuse |
|
|