Returns a list of
Players who are assigned to the
Player is considered assigned if their
Player/Team property is equal to the
Player/Neutral is false.
This function has a number of potential uses, including counting the number of players on a
Team or giving every
Player on a
An array of
The example below prints the number of players on each Team.
-- count how many players are on each team local teams = game:GetService("Teams"):GetTeams() for _, team in pairs(teams) do local players = team:GetPlayers() print("Team " .. team.Name .. " has " .. #players .. " players") end