Hello Im kinda new to scripting and have been watching tutorials however i cant seem to find out how to tween a frame out when another one is opened.
Heres the script:
Script
local btn = script.Parent
local isHovering = false
local tweener = script.Parent.Parent.Parent.Pets.Frame
btn.MouseEnter:Connect(function()
isHovering = true
btn:TweenSize(UDim2.new(0.053, 0,0.087, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
script.Parent.HoveSound:Play()
end)
btn.MouseLeave:Connect(function()
isHovering = false
btn:TweenSize(UDim2.new(0.047, 0,0.077, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
btn.MouseButton1Down:Connect(function()
btn:TweenSize(UDim2.new(0.047, 0,0.077, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
script.Parent.ClickSound:Play()
tweener:TweenPosition(
UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
1.2,
true
)
end)
btn.MouseButton1Up:Connect(function()
if not isHovering then
btn:TweenSize(UDim2.new(0.047, 0,0.077, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
else
btn:TweenSize(UDim2.new(0.053, 0,0.087, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end
end)
Thanks!