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

How do I make the Background color of a GUi change correctly?

Asked by
mnaj22 44
8 years ago

I have tried -

function onClicked()
    script.Parent.BackgroundColor3 = Color3.new(121, 121, 121)
script.Parent.MouseButton1Click:connect(onClicked)

And the color ended up being - (30855, 30855, 30855)

1 answer

Log in to vote
1
Answered by
NotSoNorm 777 Moderation Voter
8 years ago

You must diving by 255 to get a 0 - 1 value

function onClicked()
    script.Parent.BackgroundColor3 = Color3.new(121/255, 121/255, 121/255)
end
script.Parent.MouseButton1Click:connect(onClicked)

0
Thank you :D mnaj22 44 — 8y
Ad

Answer this question