Read above. :). I'm looking for different ways so I can choose the one that works best for me. Thank you!
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()