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

Why is this scripting not changing the gui?

Asked by
TrollD3 105
8 years ago

when I hover over a textbutton, The color I want is not showing. I dont know why and I check and tried everything I could with this. All I want to do is make the textbutton background color orange and the textlabel color black.

local orange = Color3.new(255, 154, 12)
local white = Color3.new(255,255,255)
local black  = Color3.new(0,0,0)
function menu()
    wait()
    script.Parent.BackgroundColor3 = orange
    script.Parent.TextLabel.TextColor3 = black
    script.Parent.BackgroundTransparency = 0

end
script.Parent.MouseEnter:connect(menu)





function change()
    script.Parent.BackgroundTransparency = 0.5
    script.Parent.BackgroundColor3 = black 
    script.Parent.TextLabel.TextColor3 = white
end
script.Parent.MouseLeave:connect(change)

https://gyazo.com/02ef7d1082c13a9a21a2c1b3379b67cb -- The explorer view.

https://gyazo.com/4665908d98dfac42214f64bcb7624b2b -- What it looks like when I use the script

1 answer

Log in to vote
1
Answered by 8 years ago

local orange = Color3.new(255, 154, 12) should be local orange = Color3.new(255, 154/255, 12/255), reason being that Color3 is [0-1] instead of [0-255]

0
thanks. You are awesome. TrollD3 105 — 8y
Ad

Answer this question