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
01 | local Players = game.Players:GetPlayers() -- This Line Get a list of players |
02 |
03 | local Team = game.Teams.Prisoner -- Put your team in here |
04 |
05 | local InTeam = { } -- This is the list of Players is on Team Prisoner |
06 |
07 | for _, Player in pairs (Players) do |
08 | if Player.Team = = Team then |
09 | table.insert(InTeam, Player) |
10 | end |
11 | end |
12 |
13 | print (#InTeam) |
A simple solution to this is simply:
1 | local players = game.Players:GetPlayers() |
2 |
3 | print (#players) -- prints the number of players |