I don't really use teams that much so I'm no very good at coding with them. I want to make it so if someone tries to join a team, but it has 25 players in it, nothing will happen. But, since I don't really know how to get the amount of players in a team, I just kind of guessed.
local b = game.Teams.Cops:GetChildren() if b == 25 then print("nope") end
Would code like that work, or are the amount of players on a team stored differently?
You want to use the GetPlayers()
method when it comes to game.Players
or a Team.
local b = game.Teams.Cops:GetPlayers() -- this method returns a table of all the players if #b == 25 then -- the # operator gets the length of the table print("nope") end