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

Scrolling over GUI?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

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)
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. c0des 207 — 10y
0
Thanks, It was my Frame I accidentally set it as active and it was overlapping. NotSoNorm 777 — 10y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

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. :>

Ad

Answer this question