|
| 23 Feb 2012 04:10 PM |
This won't work. I've tried EVERYTHING. Basicly, it changes a bricks color when its parent is clicked. I added something so if the generator is orange and is clicked, it also works. But it broke it. Any help?
x = script.Parent.Parent.GenColor function onClicked() if x.BrickColor == BrickColor.new("Lime green") then x.BrickColor = BrickColor.new("Really red") elseif x.BrickColor == BrickColor.new("Really red") then x.BrickColor = BrickColor.new("Lime green") elseif x.BrickColor == BrickColor.new("Deep orange") then x.BrickColor = BrickColor.new("Lime green") end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Feb 2012 04:34 PM |
x = script.Parent.Parent.GenColor function onClicked() if x.BrickColor == BrickColor.new("Lime green") then x.BrickColor = BrickColor.new("Really red") elseif x.BrickColor == BrickColor.new("Really red") then x.BrickColor = BrickColor.new("Deep orange") -- changed this. Derp.(no herp) elseif x.BrickColor == BrickColor.new("Deep orange") then x.BrickColor = BrickColor.new("Lime green") end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
|
| 23 Feb 2012 04:36 PM |
| I wasn't wanting that. The brick starts orange for certain purposes. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2012 04:38 PM |
| Then it should work, I've tested. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2012 04:42 PM |
| Then what's wrong with mine? Everythihng should work, but it doesn't. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2012 04:44 PM |
maybe you connected it wrong? maybe the last line should be x.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|