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

How to change color on click?

Asked by 4 years ago
local cd = script.Parent

cd.MouseClick:Connect(function()
      script.Parent.Parent.BrickColor = BrickColor.new("Red")
end

1 answer

Log in to vote
1
Answered by
AAzterr 27
4 years ago

You were pretty close. 2 things: First of all, there is no Red BrickColor. There is stuff like Maroon and Really red. Second of all, you forgot to place a close bracket at the end to close off the connected function.

local cd = script.Parent

cd.MouseClick:Connect(function()
      script.Parent.Parent.BrickColor = BrickColor.new("Really red")
end)
0
There is red brick color. script.Parent.Parent.BrickColor = BrickColor.Red SilentsReplacement 468 — 4y
Ad

Answer this question