|
| 29 Sep 2017 12:30 AM |
| I need a script that takes all the players on one team and converts them to another. I have tried a few things bu they don't work. Thanks! |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 29 Sep 2017 01:24 AM |
| Not very clear on what you want done, do you mean mix the teams up? |
|
|
| Report Abuse |
|
|
Extuls
|
  |
| Joined: 02 Jan 2009 |
| Total Posts: 5557 |
|
|
| 29 Sep 2017 01:25 AM |
| Can we see some of the stuff you tried? |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 29 Sep 2017 01:30 AM |
If so just collect all the players in an array then do something like math.random(1,#ofteams) and log each player with the number or team color to be changed to then change all their teams.
Like so:
function swapplayers() local teams = game.Teams:GetChildren() for i,v in pairs(game.Players:GetPlayers()) do v.TeamColor = teams[math.random(1,#teams)].TeamColor end end
Something like that it's been a while sense I've opened studio.
|
|
|
| Report Abuse |
|
|
Extuls
|
  |
| Joined: 02 Jan 2009 |
| Total Posts: 5557 |
|
|
| 29 Sep 2017 01:32 AM |
| Players actually have a 'Team' property now. No more needing to set the team colors. |
|
|
| Report Abuse |
|
|
| |
|