Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

wont count the amount of players on this team. can you help me?

local teams = game:GetService("Teams"):GetTeams()
for _, team in pairs(teams) do
    local players = game.Teams.Playing:GetPlayers()
    print(players)
end

I just need to check how many people are on the players team, but when i run this code it spits out this: table: 38F02E78 I have no idea what is going on.

1 comment

0

GetPlayers returns an array. You can use the # to get the lenght of that array ie print(#players)

1 answer

✓ Accepted answer

GetPlayers() returns a table of the players, you can get the length of the table (the amount of elements in it) by doing #table. So you could print the amount of players in the team with print(#players).

1 comment

0

thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.