generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: New Post - Script Help?

Previous Thread :: Next Thread 
IceOrb is not online. 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 is not online. 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 is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
03 Jun 2013 05:21 PM
*local d = ls:findFirstChild("Deaths")
Report Abuse
IceOrb is not online. IceOrb
Joined: 02 May 2010
Total Posts: 1206
03 Jun 2013 05:28 PM
Alright, I'll test this! Thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image