|
| 11 Apr 2012 11:04 PM |
To the average advanced scripter, it probably isnt, to me it is though. It is supposed to take the people on the "Bright violet" team ONLY, and split them in half. One half will go on the blue team and the other will go on the red. Any ideas? I was thinking:
players = game.Players:GetChildren() for i = 1, 2players do if players[i].TeamColor == "Bright violet" then players[i].TeamColor = BrickColor.new("Bright red") end else end for i = 2, 2players do if players[i].TeamColor == "Bright violet" then players[i].TeamColor = BrickColor.new("Bright blue") end else end
The above is most likely incorrect, please help me. |
|
|
| Report Abuse |
|
|
|
| 11 Apr 2012 11:40 PM |
Try this:
players = game.Players:GetChildren() local haha = 0 for i = 1, #players do if players[i].TeamColor == BrickColor.new(""Bright violet") then if haha == 0 then haha = 1 players[i].TeamColor = BrickColor.new("Bright red") else haha = 0 players[i].TeamColor = BrickColor.new("Bright blue") end end end |
|
|
| Report Abuse |
|
|
|
| 11 Apr 2012 11:41 PM |
Very clever, I'll try it. brb
|
|
|
| Report Abuse |
|
|
|
| 11 Apr 2012 11:50 PM |
Well to explain that, I first corrected some syntax errors such as:
if players[i].TeamColor == "Bright violet" then to if players[i].TeamColor == BrickColor.new(""Bright violet") then
and
for i = 1, 2players do to for i = 1, #players do
Then I used a variable "haha" to alternate between the teams the players will join when haha is 0, then the player will join as red and haha switches to 1. If it is not 0, then the player joins blue and haha switches to 0.
Don't mind my variable names =P |
|
|
| Report Abuse |
|
|