Help with backroundcolor3

Hi,

Im making a script so that when you press and image button it will change the color of a frame. The issue is when I click it the frame doesn’t change color.

script

script.Parent.MouseButton1Click:Connect(function()

script.Parent.Parent.BackgroundColor3(25, 255, 62)

end)

locations

Screen Shot 2021-04-07 at 3.25.36 PM

I hope you can help me! Also I’m not sure to use a local or script.

When setting a Color3, you have to assign it like this:
Color3.[constructor](number, number, number).

For your case, your script should be:

script.Parent.MouseButton1Click:Connect(function()

script.Parent.Parent.BackgroundColor3 = Color3.fromRGB(25, 255, 62)

end)

There are other color3s functions you can use as well.
(documentation)

2 Likes

thanks! This worked! :slight_smile: