Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Changing the color of a brick?

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

✓ Accepted answer

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 ..

2 comments

0

Thanks!

0

np

This discussion is preserved as it was. New answers, comments, and votes are closed.