Read above. :). I'm looking for different ways so I can choose the one that works best for me. Thank you!
✓ ANSWER ACCEPTED
What are the different ways to create a list of the players on a certain team?
1 answer
✓ Accepted answer
Use game.Players:GetChildren(), run a check to see which team they're in, then use table.insert() to put their name/player in the Team's table. Beforehand, create X tables, for how many teams there are.
Example:
local blueTeam = {}
local redTeam = {}
while true do
wait(30)
local p = game.Players:GetChildren()
for i = 1,#p do
if p[i].TeamColor == game.Teams.RedTeam.TeamColor then
table.insert(redTeam,p.Name)
elseif p[i].TeamColor == game.Teams.BlueTeam.TeamColor then
table.insert(blueTeam,p.Name)
end
end
wait()
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you.