Oh this isnt the full code let me send you the full version
local tweenservice = game:GetService("TweenService")
local frames = script.Parent
local frameopenspeed = 1.2
local frameclosespeed = 0.5
function module.CloseFrame(object)
local opentween = tweenservice:Create(object, TweenInfo.new(frameopenspeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out),
{Size = UDim2.fromScale(1, 1)}
)
end
function module.CloseAllFrames()
end
function module.OpenFrame(frame)
local object = frame
if object == nil then
print("error object = nil")
end
print(object)
object.Size = UDim2.fromScale(0, 0)
task.wait(frameclosespeed*0.1)
object.Visible = true
local opentween = tweenservice:Create(object, TweenInfo.new(frameopenspeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In),
{Size = UDim2.fromScale(0, 0)}
)
opentween:Play()
end
return module
object:TweenPosition(Udim2.new(enter your new position/size), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 2) -- the number is the duration of the tween