I read up on a previous page on how to get the names of players in-game, and then put them in a text box. I have tried adjusting the script but when I do so it errors out. I am hoping someone can help me do the same thing, but only with players from a set team. Any help is greatly appreciated.
COMMUNITY QUESTION
How do I get the name of players on a team?
1 answer
You are going to have to use the 'GetPlayers()' function.
game.Teams.TEAMNAME:GetPlayers()
Replace 'TEAMNAME' with the name of the team.
So basically, you could do a for loop.
for i,v in pairs(game.Teams.TEAMNAME:GetPlayers()) do
print(v.Name)
end
In a for loop, 'v' refers to the value, so for every player in the team, it will print out their name.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
I updated the answer with a way to get their names.
Mark it as answered please :D
I dont know how
Just click on the big green checkmark.
There is no checkmark\
WHY is this getting disliked, it's a perfectly good answer
Exactly, people are disliking me for no reason ;-;