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

How to make a script run when a TextButton is hovered over by the mouse?

1 answer

✓ Accepted answer

Hello, I'm not exactly sure if this is answered of not, but. We use a event called the MouseEnter event here's an example;

local GuiObject = -- your gui object

GuiObject.MouseEnter:Connect(function()
	-- your code
end)

this will fire when the mouse is inside of GuiObject.

If this is in startergui then it would look more like this;

local GO = script.Parent

GO.MouseEnter:Connect(function()
	-- your code
end)

This would only work if the script was a Local Script and it was placed inside of the GuiObject.

If this helped then please accept answer ;)

Good Luck and Have Fun developing!

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