Advertisement
overgrinds

OVP Library

Oct 21st, 2024 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.26 KB | None | 0 0
  1. -- // Services
  2. local CoreGui = game:GetService('CoreGui')
  3. local TweenService = game:GetService('TweenService')
  4. local UserInputService = game:GetService('UserInputService')
  5. local RunService = game:GetService('RunService')
  6. local TextService = game:GetService('TextService')
  7. local Players = game:GetService('Players')
  8. local HttpService = game:GetService('HttpService')
  9.  
  10. -- // Preset
  11. local MainColor3 = Color3.fromRGB(30, 30, 36)
  12. local WhiteColor3 = Color3.fromRGB(255, 255, 255)
  13.  
  14. local Duplicate = CoreGui:FindFirstChild("OVP Gui")
  15. if Duplicate then
  16.     Duplicate:Destroy()
  17. end
  18.  
  19. local OVP_Gui = Instance.new("ScreenGui")
  20. OVP_Gui.Name = "OVP Gui"
  21. OVP_Gui.Parent = CoreGui
  22.  
  23. local OVP_Frame = Instance.new("Frame")
  24. OVP_Frame.Name = "OVP Frame"
  25. OVP_Frame.Parent = OVP_Gui
  26. OVP_Frame.Size = UDim2.new(0, 200, 0, 40)
  27. OVP_Frame.Position = UDim2.new(0, 5, 0, 0)
  28. OVP_Frame.BackgroundColor3 = MainColor3
  29. OVP_Frame.BorderColor3 = WhiteColor3
  30.  
  31. local RoundedCorner = Instance.new("UICorner")
  32. RoundedCorner.CornerRadius = UDim.new(0, 5)
  33. RoundedCorner.Parent = OVP_Frame
  34.  
  35. local OVP_Text = Instance.new("TextLabel")
  36. OVP_Text.Parent = OVP_Frame
  37. OVP_Text.Name = "OVP Header"
  38. OVP_Text.Text = "OVP"
  39. OVP_Text.Font = "ArimoBold"
  40. OVP_Text.TextSize = 18
  41. OVP_Text.TextColor3 = WhiteColor3
  42. OVP_Text.Size = UDim2.new(0, 190, 0, 40)
  43. OVP_Text.Position = UDim2.new(0, 10, 0, 0)
  44. OVP_Text.TextXAlignment = "Left"
  45. OVP_Text.BorderSizePixel = 0
  46. OVP_Text.BackgroundTransparency = 1
  47.  
  48. local ScrollingFrame = Instance.new("ScrollingFrame")
  49. ScrollingFrame.Name = "Scrolling Frame"
  50. ScrollingFrame.Parent = OVP_Frame
  51. ScrollingFrame.Size = UDim2.new(0, 0, 0, 0)
  52. ScrollingFrame.Position = UDim2.new(0, 0, 0, 40)
  53. ScrollingFrame.ScrollBarThickness = 0
  54. ScrollingFrame.BorderSizePixel = 0
  55. ScrollingFrame.BackgroundColor3 = MainColor3
  56.  
  57. -- // Tween Service
  58. local function onMouseEnter()
  59.     local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  60.     local goal = {Size = UDim2.new(0, 200, 0.5, 0)}  -- New size
  61.  
  62.     local tween = TweenService:Create(OVP_Frame, tweenInfo, goal)
  63.     tween:Play()
  64.  
  65.     local scrollTween = TweenService:Create(ScrollingFrame, tweenInfo, {Size = UDim2.new(1, 0, 1, -50)})
  66.     scrollTween:Play()
  67. end
  68.  
  69. -- // Function
  70. local function updateCanvasSize()
  71.     local totalHeight = 0
  72.     for _, child in pairs(ScrollingFrame:GetChildren()) do
  73.         if child:IsA("GuiObject") then
  74.             totalHeight = totalHeight + child.Size.Y.Offset + listLayout.Padding.Offset
  75.         end
  76.     end
  77.     scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, totalHeight)
  78. end
  79. ScrollingFrame.ChildAdded:Connect(updateCanvasSize)
  80. ScrollingFrame.ChildRemoved:Connect(updateCanvasSize)
  81.  
  82. local function onMouseLeave()
  83.     local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  84.     local goal = {Size = UDim2.new(0, 200, 0, 40)}  -- Reset size
  85.  
  86.     local tween = TweenService:Create(OVP_Frame, tweenInfo, goal)
  87.     tween:Play()
  88.  
  89.     local scrollTween = TweenService:Create(ScrollingFrame, tweenInfo, {Size = UDim2.new(0, 0, 0, 0)})
  90.     scrollTween:Play()
  91. end
  92.  
  93. -- Connect mouse events to the frame
  94. OVP_Frame.MouseEnter:Connect(onMouseEnter)
  95. OVP_Frame.MouseLeave:Connect(onMouseLeave)
  96.  
  97. local OVP_Library = {}
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. return OVP_Library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement