I want only a certain amount of people to be on a team at once, and I want a variable to have the number of people on that team. So, basically, how do I find how many people are on a team?
This is my attempt at the script:
local Teams = game:GetService("Teams")
local Team1 = Teams.Host
-- Lets say theres 10 players in Team1, and 8 in Team2..
local amnt = (#Team1:GetChildren())
script.Parent.MouseButton1Down:connect(function()
if amnt == 0 then
script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright red")
end
end)

1 comment
You would want to set up a variable then loop through all players adding on to that variable for every player that is on the specified team. Without an attempt at a script I can not help.