Venitel
|
  |
| Joined: 28 Jul 2012 |
| Total Posts: 706 |
|
|
| 13 Dec 2012 07:58 PM |
local Players=game:service("Players"):GetPlayers() for v=1, #Players do if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then Players[v].TeamColor=BrickColor.new("Cyan") elseif (Players[v].TeamColor==game.Teams["Raiders"].TeamColor) Players[v].TeamColor=BrickColor.new("Bright green") for _,v in pairs(game.Players:GetChildren()) do if v.Character then v.Character:BreakJoints() end end end end
Everytime this script is enabled then it changed my team to neutral. and yes. I am in 123123 group (SC)
I am wanting this script to do this.
When enabled,
Any person in SC(123123) on the team "Raiders" (Bright red) to be changed to the team SC (Cyan) and if they are on the Raiders team but not in SC then to change to "Friendlies" (Bright green). and then kills everyone.
Thanks! |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2012 07:59 PM |
You forgot a then on the elseif line.
¤ † KMXD† ¤ |
|
|
| Report Abuse |
|
|
Venitel
|
  |
| Joined: 28 Jul 2012 |
| Total Posts: 706 |
|
|
| 13 Dec 2012 08:01 PM |
local Players=game:service("Players"):GetPlayers() for v=1, #Players do if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then Players[v].TeamColor=BrickColor.new("Cyan") elseif (Players[v].TeamColor==game.Teams["Raiders"].TeamColor) then Players[v].TeamColor=BrickColor.new("Bright green") for _,v in pairs(game.Players:GetChildren()) do if v.Character then v.Character:BreakJoints() end end end end
still didn't work with then there |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2012 08:04 PM |
Move an end to after changing the raiders to the green team.
¤ † KMXD† ¤ |
|
|
| Report Abuse |
|
|
Venitel
|
  |
| Joined: 28 Jul 2012 |
| Total Posts: 706 |
|
|
| 13 Dec 2012 08:05 PM |
So..
local Players=game:service("Players"):GetPlayers() for v=1, #Players do if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then Players[v].TeamColor=BrickColor.new("Cyan") elseif (Players[v].TeamColor==game.Teams["Raiders"].TeamColor) then Players[v].TeamColor=BrickColor.new("Bright green") end for _,v in pairs(game.Players:GetChildren()) do if v.Character then v.Character:BreakJoints() end end end
like that? |
|
|
| Report Abuse |
|
|
Venitel
|
  |
| Joined: 28 Jul 2012 |
| Total Posts: 706 |
|
|
| 13 Dec 2012 08:07 PM |
| If so, then no... it didn't ): |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2012 08:11 PM |
game:GetService("Players") not game:service("Players") |
|
|
| Report Abuse |
|
|
Venitel
|
  |
| Joined: 28 Jul 2012 |
| Total Posts: 706 |
|
|
| 13 Dec 2012 08:16 PM |
| Nope, it still changes me to neutral |
|
|
| Report Abuse |
|
|
Venitel
|
  |
| Joined: 28 Jul 2012 |
| Total Posts: 706 |
|
|
| 13 Dec 2012 08:18 PM |
local Players=game:GetService("Players"):GetPlayers() for v=1, #Players do if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then Players[v].TeamColor=BrickColor.new("Cyan") elseif (Players[v].TeamColor==BrickColor.new("Bright red")) then Players[v].TeamColor=BrickColor.new("Bright green") for _,v in pairs(game.Players:GetChildren()) do if v.Character then v.Character:BreakJoints() end end end end
I don't know if the end at the end of the elseif line did anything |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2012 08:43 PM |
Try moving two ends up there, one for the condition, the other the loop.
¤ † KMXD† ¤ |
|
|
| Report Abuse |
|
|