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

How to change this mouse moved script?

I made this script to move a text button when the mouse hovers over it. How do I make the text button slide into its position (not quickly moving from one position to the next)? Also how do I keep the text button in that position (when the mouse hovers on the txt button) until the mouse leaves the text button? This is the script I made.

debounce = false
script.Parent.MouseMoved:connect(function() 
if debounce == false then
script.Parent.Position = UDim2.new(0, -30, 0, 240)
script.Parent.HoverLine.Visible = true
wait(.2)
debounce = true
wait(.1)
script.Parent.HoverLine.Visible = false
script.Parent.Position = UDim2.new(0, 0, 0, 240)
debounce = false
end
end)

1 answer

✓ Accepted answer

You would just use the MouseEnter Event, it runs when the Mouse hovers over the UI/gui.

@

2 comments

0

would I replace the mouse entered with mouse moved and how would I let the txt button slide back into the position slowly/smoothly?

0

Easy just make another event called "MouseLeave".

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