Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// X = Horizontal, Y = Vertical
- -- Variables
- local TweenService = game:GetService("TweenService")
- local CoreGui = game:GetService("CoreGui")
- local OVPGui = CoreGui:WaitForChild("OVPGui")
- local Spacing = 10
- local StartX = -65
- local TotalWidth = 0
- -- Calculate Total Width + Spacings
- for _, v in ipairs(OVPGui:GetChildren()) do
- if v:IsA(("Frame")) then
- TotalWidth = TotalWidth + v.Size.X.Offset + Spacing
- end
- end
- -- TotalWidth = TotalWidth - Spacing -- Remove Last Frame Spacing
- -- Sorting Position From Right Side
- local CurrentX = -TotalWidth + StartX
- -- Loop through the children of OVPGui and position them
- for _, v in ipairs(OVPGui:GetChildren()) do
- if v:IsA("Frame") then
- v.Position = UDim2.new(1, 0, 0, -50)
- -- Create a tween for each frame's position
- local TI = TweenInfo.new(
- 0.5, -- Duration (adjust as needed)
- Enum.EasingStyle.Quad, -- Easing style (smooth effect)
- Enum.EasingDirection.Out -- Easing direction (slows down at the end)
- )
- local TargetPost = UDim2.new(1, CurrentX, 0, -50) -- Final position for the tween
- -- Create the tween
- local TweenIntro = TweenService:Create(v, TI, {Position = TargetPost})
- -- Play the tween
- TweenIntro:Play()
- -- Update the currentX for the next frame
- CurrentX = CurrentX + v.Size.X.Offset + Spacing
- end
- end
- for _, v in ipairs(OVPGui:GetChildren()) do
- if v:IsA("ImageButton") then
- v.Position = UDim2.new(1, 0, 0, -50)
- -- Create a tween for each frame's position
- local TI = TweenInfo.new(
- 0.5, -- Duration (adjust as needed)
- Enum.EasingStyle.Quad, -- Easing style (smooth effect)
- Enum.EasingDirection.Out -- Easing direction (slows down at the end)
- )
- local TargetPost = UDim2.new(1, -65, 0, -50) -- Final position for the tween
- -- Create the tween
- local TweenIntro = TweenService:Create(v, TI, {Position = TargetPost})
- -- Play the tween
- TweenIntro:Play()
- -- Update the currentX for the next frame
- CurrentX = CurrentX + v.Size.X.Offset + Spacing
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement