How do you do something when the mouse hovers over a Gui? What is the function you would set up for it?
For this, simply use the handle MouseEnter and MouseLeave events.
1 | --Example Script |
2 | local Button = script.Parent |
3 | Button.BackgroundColor 3 = Color 3. new( 1 , 0 , 0 ) |
4 | Button.MouseEnter:connect( function () |
5 | Button.BackgroundColor 3 = Color 3. new( 1 , 1 , 1 ) |
6 | end ) |
7 | Button.MouseLeave:connect( function () |
8 | Button.BackgroundColor 3 = Color 3. new( 1 , 0 , 0 ) |
9 | 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 :)