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: Brick Color is breaking my script... Help?

Previous Thread :: Next Thread 
Hazor is not online. Hazor
Joined: 09 Feb 2009
Total Posts: 5804
22 Apr 2014 04:52 PM
This is for a light switch. The intent is to disable light from two sources, and change the color of the button on one click. The button color tells you if the lights are on or off. I have this through two scripts, an "On" script, and an "Off" switch. My problem is the brick color part.


light1 = script.Parent.Parent.Parent.OverheadSet1.LightPart.PointLight
light2 = script.Parent.Parent.Parent.OverheadSet2.LightPart.PointLight


function onClicked()
light1.Enabled = true
light2.Enabled = true
script.Parent.Off.Disabled = false
script.Disabled = true
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Works perfectly fine, but when I change the function to:

function onClicked()
light1.Enabled = true
light2.Enabled = true
script.Parent.BrickColor = "Dark Green"
script.Parent.Off.Disabled = false
script.Disabled = true
end

the script breaks. Can anyone point me to what I'm doing wrong here?
Report Abuse
redlo43 is not online. redlo43
Joined: 16 Feb 2011
Total Posts: 4722
22 Apr 2014 04:53 PM
script.Parent.BrickColor = "Dark Green"

script.Parent.BrickColor = BrickColor.new("Dark Green")
Report Abuse
Hazor is not online. Hazor
Joined: 09 Feb 2009
Total Posts: 5804
22 Apr 2014 04:53 PM
Thanks
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Apr 2014 04:53 PM
BrickColor.new'Dark green'

Not "Dark Green"
Report Abuse
Ace23333 is not online. Ace23333
Joined: 20 Nov 2011
Total Posts: 1341
22 Apr 2014 04:54 PM
script.Parent.BrickColor = BrickColor.new("Dark green")
Report Abuse
Mlatu is not online. Mlatu
Joined: 01 Aug 2011
Total Posts: 540
22 Apr 2014 04:54 PM
script.Parent.BrickColor = BrickColor.new("Dark green")
--capitalization matters !_!
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