Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ImageColor3 wont change after tweening.?

gyazo.com/d8dac3c9d4328beea430279ab3b9c892

After i open the gui Menu the 1st button is supposed to go dark with ImageColor3 but it wont work..

local Button = script.Parent

script.Parent.MouseEnter:connect(function()
	Button.ImageColor3 = Color3.fromRGB(158,158,158)
end)

script.Parent.MouseLeave:connect(function()
	Button.ImageColor3 = Color3.fromRGB(255,255,255)
end)

1 comment

0

I just tested this code and it works fine. Don't post code that works and ask us to fix it. Is the script disabled? Show us the tweening too please.

1 answer

I have never personally used fromRGB(), so i don't know much about it. I find that just doing new works everytime for me. I don't know if you have given it a try, but it might work.

local Button = script.Parent;

script.Parent.MouseEnter:connect(function()
	Button.ImageColor3 = Color3.new(158/255,158/255,158/255);
end);

script.Parent.MouseLeave:connect(function()
	Button.ImageColor3 = Color3.new(1, 1, 1);
end);

Best of luck. Hope this helps.

2 comments

0

Color3.new() Takes three numbers that are between 0 and 1. This would not work for that reason. https://gyazo.com/9ac8d084c0462e5e657c90791e7d7c51

0

This code does work. (ps. I am really tired and forgot to do that /255 in the first place.)

This discussion is preserved as it was. New answers, comments, and votes are closed.