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

something when the mouse hovers?

How do you do something when the mouse hovers over a Gui? What is the function you would set up for it?

1 answer

✓ Accepted answer

For this, simply use the handle MouseEnter and MouseLeave events.

--Example Script
local Button = script.Parent
Button.BackgroundColor3 = Color3.new(1, 0, 0)
Button.MouseEnter:connect(function()
	Button.BackgroundColor3 = Color3.new(1, 1, 1)
end)
Button.MouseLeave:connect(function()
	Button.BackgroundColor3 = Color3.new(1, 0, 0)
end)

That script will change a button's background color to white when the mouse is over it, and red (I think) when the mouse is not over the button. Hope this helps :)

1 comment

0

thx!

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