Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Animation Proximity Tween size and position
- -// My grammar is weird
- -// made by allvideo
- local OriginalSize = {}
- local IsTweening = {}
- script.Parent.Triggered:Connect(function(plr)
- if plr.PlayerGui and plr.PlayerGui:FindFirstChild("ScreenGui2") and plr.PlayerGui.ScreenGui2:FindFirstChild("Frame") then
- local frame = plr.PlayerGui.ScreenGui2.Frame
- if not frame.Visible and not IsTweening[plr] then
- if not OriginalSize[plr] then
- OriginalSize[plr] = frame.Size
- else
- frame.Size = OriginalSize[plr]
- end
- frame.AnchorPoint = Vector2.new(0.5,0.5)
- frame.Position = UDim2.new(0.5,0,-1,0)
- frame.Visible = true
- IsTweening[plr] = true
- frame:TweenPosition(UDim2.new(0.5,0,0.5,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5, true, function()
- frame:TweenSize(OriginalSize[plr] + UDim2.new(0.2,0,0.2,0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,0.5, true,function() IsTweening[plr] = false end)
- end)
- elseif not IsTweening[plr] then
- frame.Visible = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement