TheJKM98
|
  |
| Joined: 20 Dec 2010 |
| Total Posts: 511 |
|
|
| 17 Nov 2013 05:00 PM |
The following code is in a LocalScript:
while true do if game.Players.LocalPlayer.Character.Humanoid.Health == 0 then game.Players.LocalPlayer.TeamColor = BrickColor.new("White") end wait() end
The problem: Every time the player dies, they stay on their team. There are no errors in the output, so why isn't the dead player changing teams? |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 17 Nov 2013 05:01 PM |
if game.Players.LocalPlayer.Character.Humanoid.Died:connect(function() game.Players.LocalPlayer.TeamColor = BrickColor.new("White") end)
|
|
|
| Report Abuse |
|
|
TheJKM98
|
  |
| Joined: 20 Dec 2010 |
| Total Posts: 511 |
|
|
| 17 Nov 2013 05:03 PM |
| The format is incorrect, please revise |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
| |
|
TheJKM98
|
  |
| Joined: 20 Dec 2010 |
| Total Posts: 511 |
|
|
| 17 Nov 2013 05:06 PM |
Look again, there is no 'then'
Can someone please revise? |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2013 05:08 PM |
| It doesn't need it then, it works. |
|
|
| Report Abuse |
|
|
TheJKM98
|
  |
| Joined: 20 Dec 2010 |
| Total Posts: 511 |
|
|
| 17 Nov 2013 05:11 PM |
| There must be something wrong, because when I reset the player, they stay on the same team. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2013 05:13 PM |
You need to make sure they have a character and humanoid. Or just make it a normal on enter script |
|
|
| Report Abuse |
|
|