UI Change Colour on Click

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want it so you can click on one of the 3 ImageButtons, and that changes the signal colour.

  2. What is the issue?
    I’m getting an error:

  3. What solutions have you tried so far?
    I tried changing the type like BackgroundColor, but had no hope. If anyone has any ideas, please let me know.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local SignallingBackPanel = script.Parent.Parent
local Signal = SignallingBackPanel.Signal1
local Frame = script.Parent
local GreenButton = Frame.Green
local YellowButton = Frame.Yellow
local RedButton = Frame.Red

Frame.Green.MouseButton1Click:Connect(function()
	SignallingBackPanel.Signal1.ImageColor3 = "68, 255, 0"
end)

Frame.Yellow.MouseButton1Click:Connect(function()
	SignallingBackPanel.Signal1.ImageColor3 = "255, 229, 35"
end)

Frame.Red.MouseButton1Click:Connect(function()
	SignallingBackPanel.Signal1.ImageColor3 = "255, 26, 26"
end)

image

1 Like

the value needs to be a color3 example:

SignallingBackPanel.Signal1.ImageColor3 = Color3.fromRGB(68, 255, 0)

I’ve done this, but now the colour doesn’t change and no errors are produced.

edit: fixed it with backgroundcolor3

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.