I was trying to make a gun that can be picked up if clicked on. But i do not know the function for mouse hover or click. Can someone help me with this?
To check if a button was hovered on, you can use the MouseEnter
event.
This won't work on parts though.
i.e
1 | gui = game.Player.SomeDude.RandomGUI |
2 | button = gui.RandomButton |
3 | button.MouseEnter:connect( function () |
4 | button.BackgroundTransparency = 0.5 -- Makes the background transparent when you hover over the button. |
5 | end ) |
Hope this helped!