I Am Really Close On Finishing A Game And I Don't Know How To Find The Amount Of Players On A Team
I need Some Help
i think this is help u
local Players = game.Players:GetPlayers() -- This Line Get a list of players local Team = game.Teams.Prisoner -- Put your team in here local InTeam = {} -- This is the list of Players is on Team Prisoner for _, Player in pairs(Players) do if Player.Team == Team then table.insert(InTeam, Player) end end print(#InTeam)
A simple solution to this is simply:
local players = game.Players:GetPlayers() print(#players) -- prints the number of players