Greetings Reader!
My goal is to make a repetitive cycle in where if my mouse hovers over my GUI
it expands, and when it leaves the GUI it shrinks back to its original size.
The problem I’m having is that I already did the script but, it just won’t work unless I hover, over and over quickly. I want it to immediately work when the mouse leaves the GUI
.
I’ve made 2 LocalScripts
located at my ImageButton
.
My MouseLeave Script:
local frame1 = script.Parent.Parent.Easy
local frame2 = script.Parent.Parent.EasyBackdrop
local frame3 = script.Parent.Parent.EasyBackground
script.Parent.MouseLeave:Connect(function(x, y)
frame1:TweenSize(UDim2.new(0.218, 0,0.313, 0), 'In', 'Linear', '1')
frame2:TweenSize(UDim2.new(0.218, 0,0.316, 0), 'In', 'Linear', '1')
frame3:TweenSize(UDim2.new(0.218, 0,0.313, 0), 'In', 'Linear', '1')
end)
My MouseEnter Script:
local frame1 = script.Parent.Parent.Easy
local frame2 = script.Parent.Parent.EasyBackdrop
local frame3 = script.Parent.Parent.EasyBackground
script.Parent.MouseEnter:Connect(function(x, y)
frame1:TweenSize(UDim2.new(0.233, 0,0.331, 0), 'Out', 'Linear', '1')
frame2:TweenSize(UDim2.new(0.235, 0,0.357, 0), 'Out', 'Linear', '1')
frame3:TweenSize(UDim2.new(0.229, 0,0.343, 0), 'Out', 'Linear', '1')
script.Parent.Pong:Play()
end)
If you can help me out in any way, please do!