Advertisement
overgrinds

KLO - Intro

Dec 6th, 2024
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.26 KB | Gaming | 0 0
  1. --// X = Horizontal, Y = Vertical
  2.  
  3. -- Variables
  4. local TweenService = game:GetService("TweenService")
  5. local CoreGui = game:GetService("CoreGui")
  6. local OVPGui = CoreGui:WaitForChild("OVPGui")
  7. local Spacing = 10
  8. local StartX = -65
  9. local TotalWidth = 0
  10.  
  11. -- Calculate Total Width + Spacings
  12. for _, v in ipairs(OVPGui:GetChildren()) do
  13.     if v:IsA(("Frame")) then
  14.         TotalWidth = TotalWidth + v.Size.X.Offset + Spacing
  15.     end
  16. end
  17.  
  18. -- TotalWidth = TotalWidth - Spacing -- Remove Last Frame Spacing
  19.  
  20. -- Sorting Position From Right Side
  21. local CurrentX = -TotalWidth + StartX
  22.  
  23. -- Loop through the children of OVPGui and position them
  24. for _, v in ipairs(OVPGui:GetChildren()) do
  25.     if v:IsA("Frame") then
  26.         v.Position = UDim2.new(1, 0, 0, -50)
  27.        
  28.         -- Create a tween for each frame's position
  29.         local TI = TweenInfo.new(
  30.             0.5, -- Duration (adjust as needed)
  31.             Enum.EasingStyle.Quad, -- Easing style (smooth effect)
  32.             Enum.EasingDirection.Out -- Easing direction (slows down at the end)
  33.         )
  34.  
  35.         local TargetPost = UDim2.new(1, CurrentX, 0, -50) -- Final position for the tween
  36.  
  37.         -- Create the tween
  38.         local TweenIntro = TweenService:Create(v, TI, {Position = TargetPost})
  39.        
  40.         -- Play the tween
  41.         TweenIntro:Play()
  42.        
  43.         -- Update the currentX for the next frame
  44.         CurrentX = CurrentX + v.Size.X.Offset + Spacing
  45.     end
  46. end
  47.  
  48. for _, v in ipairs(OVPGui:GetChildren()) do
  49.     if v:IsA("ImageButton") then
  50.         v.Position = UDim2.new(1, 0, 0, -50)
  51.        
  52.         -- Create a tween for each frame's position
  53.         local TI = TweenInfo.new(
  54.             0.5, -- Duration (adjust as needed)
  55.             Enum.EasingStyle.Quad, -- Easing style (smooth effect)
  56.             Enum.EasingDirection.Out -- Easing direction (slows down at the end)
  57.         )
  58.  
  59.         local TargetPost = UDim2.new(1, -65, 0, -50) -- Final position for the tween
  60.  
  61.         -- Create the tween
  62.         local TweenIntro = TweenService:Create(v, TI, {Position = TargetPost})
  63.        
  64.         -- Play the tween
  65.         TweenIntro:Play()
  66.        
  67.         -- Update the currentX for the next frame
  68.         CurrentX = CurrentX + v.Size.X.Offset + Spacing
  69.     end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement