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

Script is printing, but it's not changing the icon color?

I'm changing an image color when the mouse is over, and when it leaves. Currently, my script is printing, but it's not changing the colors at all.

local FrontColor = Color3.fromRGB(50, 188, 255)
local BackColor = Color3.fromRGB(42, 162, 217)

local Button = script.Parent

local FrontIcon = game.StarterGui.ScreenGui.ShopIcon

function MouseOver()
	print("Color changing!")
	FrontIcon.ImageColor3 = BackColor
end

function MouseLeave()
	print("Color changing back!")
	FrontIcon.ImageColor3 = FrontColor
end

Button.MouseEnter:Connect(MouseOver)
Button.MouseLeave:Connect(MouseLeave)

1 comment

0

I dont think images can change colours.. Have you tried using 2 images (each one different colours) and switching between them?

1 answer

Hey there, when defining the color as a constant or a variable, you would have to multiply the RGB values by 255 to get the actual color. right now, the number should be smaller than 0 if you were to print it

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