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

Making a button change color as it is clicked, but not setting to correct color? [Answered]

Asked by 4 years ago
Edited 4 years ago

I made this button to change color to look darker as you pressed it for just a feel and the color change doesnt work and I don't know what's going on, because its setting it to black

MenuFrame = script.Parent.Parent

script.Parent.MouseButton1Down:Connect(function()
    print("work")
    MenuFrame.Main.ImageColor3 = Color3.new("221/255, 149/255, 6/255")
    print("work2")
    MenuFrame.buttonShadow.ImageColor3 = Color3.new("172/255, 116/255, 4/255")
    print("work3")
end)

and with line 5 and 7 I also removed /255 and it didnt work. And I mean to do imagecolor because I used round images for gui

1 answer

Log in to vote
0
Answered by
Nckripted 580 Moderation Voter
4 years ago

When using the RGB color spectrum, you have to use:

local color = Color3.fromRGB(255,255,255)

Hope this helped!

0
This worked! Thanks! ethhscool1 7 — 4y
Ad

Answer this question