i cant figure out before it disappear, it will make a pop up/down animation
script :
local bilGui = script.Parent.Parent:WaitForChild("BillboardGui")
local tweenService = game:GetService("TweenService")
local frameCloseSpeed = 0.5
local closeEasingStyle = Enum.EasingStyle.Sine
local closeEasingDirect = Enum.EasingDirection.In
local frameOpenSpeed = 0.5
local openEasingStyle = Enum.EasingStyle.Sine
local openEasingDirect = Enum.EasingDirection.Out
if bilGui.MaxDistance <= 29.5 then
local frame = bilGui:WaitForChild("Frame")
if frame then
local closeTween = tweenService:Create(
frame,
TweenInfo.new(
frameCloseSpeed,
closeEasingStyle,
closeEasingDirect
),
{Size = UDim2.fromScale(0,0)}
)
closeTween:Play()
else if bilGui.MaxDistance >= 29.5 then
local frame = bilGui:WaitForChild("Frame")
if frame then
local openTween = tweenService:Create(
frame,
TweenInfo.new(
frameOpenSpeed,
openEasingStyle,
openEasingDirect
),
{Size = UDim2.fromScale(0.6,0.6)}
)
openTween:Play()
end
end
end
end