How do I make this work in a Script, not a LocalScript?
function getPlayersOnTeam(teamColor)
local players = {};
for i,v in pairs(game.Players:GetPlayers()) do
if (v.TeamColor.Name == teamColor) then
table.insert(players, v);
end end return players end;
game:GetService("RunService").RenderStepped:connect(function()
hn = #getPlayersOnTeam("Bright blue");
sn = #getPlayersOnTeam("Dark stone grey");
end)
p.s I want to have a count of the players!

2 comments
mu6666mu, does this code that you have redone constantly update the count of players on each team? or what does it do exactly?
I've edited it to constantly get the number of players