I need a script that waits until there is only 1 player on team Bright Blue ad then show a GUI in Game.Workspace.ScreenGui.WinnerGUI for 20 seconds, then make in invisible once again. Help is really appreciated! -Anth4598
Loop through each player and if they're on a given team, increase a counter by one. I'd make a function like this for it.
function teamCount( team ) local c = 0 local team = type(team) == "string" and BrickColor.new(team) or team for _, plr in pairs(Game:GetService("Players"):GetPlayers()) do if plr.TeamColor == team then c = c + 1 end end return c end print("#Players on Bright red: " .. teamCount("Bright red")) -- Alternatively print("#Players on Bright blue: " .. teamCount(BrickColor.new("Bright blue")))