Advertisement
Dfgjfj

Animation Tween ProximityPrompt

Feb 5th, 2025 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. --// Animation Proximity Tween size and position
  2. -// My grammar is weird
  3. -// made by allvideo
  4. local OriginalSize = {}
  5. local IsTweening = {}
  6. script.Parent.Triggered:Connect(function(plr)
  7. if plr.PlayerGui and plr.PlayerGui:FindFirstChild("ScreenGui2") and plr.PlayerGui.ScreenGui2:FindFirstChild("Frame") then
  8. local frame = plr.PlayerGui.ScreenGui2.Frame
  9. if not frame.Visible and not IsTweening[plr] then
  10. if not OriginalSize[plr] then
  11. OriginalSize[plr] = frame.Size
  12. else
  13. frame.Size = OriginalSize[plr]
  14. end
  15. frame.AnchorPoint = Vector2.new(0.5,0.5)
  16. frame.Position = UDim2.new(0.5,0,-1,0)
  17.  
  18. frame.Visible = true
  19. IsTweening[plr] = true
  20. frame:TweenPosition(UDim2.new(0.5,0,0.5,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5, true, function()
  21. 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)
  22. end)
  23. elseif not IsTweening[plr] then
  24. frame.Visible = false
  25. end
  26. end
  27. end)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement