local function getTeamPlayers(teamColor)
local output = {}
for _, player in pairs(game.Players:getPlayers()) do
if (not player.Neutral) and player.TeamColor == BrickColor.new(teamColor) then
table.insert(output, player)
end
end
return output
end
print(getTeamPlayers("Bright blue")) -->the number of players on the Bright blue team
function onClicked()
print "test" -- To test if it even gets up to this point
if (getTeamPlayers("Bright blue")) < 17 then
print(getTeamPlayers("Bright blue"))
game.Players.LocalPlayer.TeamColor = BrickColor.new("Bright blue")
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
The above script does not work. It is supposed to find out the number of people on one team (The top area) and when a button is pressed use the top area to find out whether it can allocate the presser to the team (hence < 17). The thing is, it outputs a table, so how can I get the output to work with the bottom?

4 comments
I still hardly understand how I could integrate this into the original script. Can you edit your answer to make it whole
Ok, I get how it works, but how do I go about including it into my original script?
Already told you to use the '#' operator but yeah, I updated it with the solution
Thanks