IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Jun 2013 05:13 PM |
Hey guys, I've recently posted before about help - Just wanted to make a new post to start a fresh. Basically I want my script to change the players team colour to "Sand Green" once their deaths equals the value of 6.
This is the script: game.Players.PlayerAdded:connect(function(plr) local ls = plr:findFirstChild("leaderstats") repeat wait() until ls local d = ls:findFirstChild("Deaths") repeat wait() until d d.Changed:connect(function() if d.Value == 6 then plr.TeamColor = BrickColor.new("Sand green") end end) end)
--- It doesn't display an output but it doesn't work either? Any help? |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 03 Jun 2013 05:20 PM |
game.Players.PlayerAdded:connect(function(plr) repeat wait() until plr:findFirstChild("leaderstats") print("found") local ls = plr:findFirstChild("leaderstats") --If leaderstats is there, then deaths is, no need to wait for it. local d = ls:findFirstChild("deaths") d.Changed:connect(function() print("changed") if d.Value == 6 then plr.TeamColor = BrickColor.new("Sand green") end end) end) |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 03 Jun 2013 05:21 PM |
*local d = ls:findFirstChild("Deaths")
|
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Jun 2013 05:28 PM |
| Alright, I'll test this! Thanks! |
|
|
| Report Abuse |
|
|