Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change this mouse moved script?

Asked by
smd34 30
9 years ago

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

Log in to vote
0
Answered by
woodengop 1134 Moderation Voter
9 years ago

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

@

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? smd34 30 — 9y
0
Easy just make another event called "MouseLeave". woodengop 1134 — 9y
Ad

Answer this question