So this script is supposed to detect how many people are on a certain team, and react to it. However, it isn't working, and I don't know why.
Can someone please help me? Here's the script:
local greenTeam = {}
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("Bright green") then
table.insert(greenTeam,v)
end
end
while wait() do
if #greenTeam == 0 then
print('Green Team Ded')
end
end

1 comment
Thank you!