Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Changing the color of a brick?

Asked by 8 years ago

So, I'm trying to get this to work and I cannot. When I click on the ClickDetector, I want the lampshade to change color, Gold in this case. This message appears and I cannot work out how to fix it. "Workspace.Part.Script:2: attempt to call field 'Gold' (a nil value)". I apologize for this question as I am quite new to scripting.

script.Parent.ClickDetector.MouseClick:connect(function()
game.Workspace.lamp1.lampshade1.BrickColor = BrickColor.Gold()
end)

2 answers

Log in to vote
0
Answered by 8 years ago

er well Gold is a nil value so do something like ...

script.Parent.ClickDetector.MouseClick:connect(function()
game.Workspace.lamp1.lampshade1.BrickColor = BrickColor.new(0.937255, 0.721569, 0.219608)
end)


yes ... and this should fix it entirely ..

0
Thanks! toughjohncena1256 57 — 8y
0
np Angels_Develop 52 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

BrickColor = BrickColor.new("Gold")

Answer this question