Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a table of the players in a particular team ? [closed]

Asked by 4 years ago

I was trying to make a different menu gui for the Vip Team and the Private Server owner

0
This is not a request site. WideSteal321 773 — 4y

Closed as Not Constructive by WideSteal321 and JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Creating tables for player in a team is easy.

Assuming that your team name is Vip. You can do:

local VipTeam = game.Teams.Vip -- It will get the team
local VipTeamTable = VipTeam:GetPlayers() -- This will create a table of the players in Vip team

GetPlayers() is used to calculate the amount of players.

Now, you have the table, you can do anything(not literally anything) with it, like:

local VipTeam = game.Teams.Vip 
local VipTeamTable = VipTeam:GetPlayers() -- It will get amount of players from Team Vip

-- If you will do, print(#VipTeamTable), it will print the number of players in Team Vip

for i, v in pairs(VipTeamTable) do -- Here, i is the number and v is the name associated with the number
    print(v) -- It will print the player's name in Vip team
end

Lemme know if it helps!

0
Explain in further detail how and why this works WideSteal321 773 — 4y
Ad