How can I make this count the players on one specific team, instead of all the teams?
local Display = script.Parent local teams = game:GetService("Teams"):GetTeams() for _, team in pairs(teams) do local players = team:GetPlayers() Display.Text = ""..#players end
Hello, ConnorThomp!
You can just check (if()
) if the team color is equals to the team that you want. Here is the code:
local Display = script.Parent local teams = game:GetService("Teams"):GetTeams() for _, team in pairs(teams) do if(team.TeamColor == BrickColor.new("Change me to the team color!")) then local players = team:GetPlayers() Display.Text = ""..#players end end
Good luck with your game!