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
|
  |
| 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
|
  |
| Joined: 09 Feb 2009 |
| Total Posts: 5804 |
|
| |
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 22 Apr 2014 04:53 PM |
BrickColor.new'Dark green'
Not "Dark Green" |
|
|
| Report Abuse |
|
|
Ace23333
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 1341 |
|
|
| 22 Apr 2014 04:54 PM |
| script.Parent.BrickColor = BrickColor.new("Dark green") |
|
|
| Report Abuse |
|
|
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 |
|
|