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

Scrolling over GUI?

I'm trying to make a shop GUI so when I scroll over it, It opens. Its working when I put my mouse over it but when I take it away real quick it doesn't go away. It stays there, But when I do it slow, It works. Is it a problem with my script or just Roblox?

function enter()
script.Parent.ShopMain:TweenPosition(UDim2.new(0,0,0.91,0), "Out", "Quint", 1, false)
end

script.Parent.MouseEnter:connect(enter)


function leave()
script.Parent.ShopMain:TweenPosition(UDim2.new(0,0,2,0), "Out", "Quint", 1, false)
end

script.Parent.MouseLeave:connect(leave)

2 comments

0

My guess is that your shop GUI has something covering whatever it is that you scroll over. Whether it is invisible or what, that is my best guess. Otherwise it would just be a ROBLOX error.

0

Thanks, It was my Frame I accidentally set it as active and it was overlapping.

1 answer

Your problem is in your TweenPosition method call.

The fifth parameter, override, designates whether or not the tween is allowed to be overridden. What is happening when you quickly move the mouse out of the window is that you are telling the window to tween closed while a non-overrideable tween is already occurring.

To fix, just change those two 'false's to 'true's. :>

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