darraghd493

Festival UI Library

Aug 26th, 2023 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 92.35 KB | Source Code | 0 0
  1. --[[
  2.     FestivalWare.lua
  3.  
  4.     A script by darraghd493 for harassing games.
  5.     This script is free to use and modify, but please give credit.
  6.  
  7.     This script is a UI library for the FestivalWare script.
  8.  
  9.     Note: This has been untouched for over two years by now.
  10. ]]
  11.  
  12. -- // Randomise the seed
  13. math.randomseed(os.time())
  14.  
  15. -- // Register services
  16. local Players = game:GetService("Players")
  17. local RunService = game:GetService("RunService")
  18. local TweenService = game:GetService("TweenService")
  19. local UserInputService = game:GetService("UserInputService")
  20. local GUIService = game:GetService("GuiService")
  21. local CoreGui = game:GetService("CoreGui")
  22.  
  23. -- // Register local variables
  24. local LocalPlayer = Players.LocalPlayer
  25. local Mouse = LocalPlayer:GetMouse()
  26.  
  27. -- // Create the library
  28. local library = {}
  29.  
  30. -- // Utility functions
  31. -- // Returns current mouse location
  32. function GetMouseLocation()
  33.     return UserInputService:GetMouseLocation() - GUIService:GetGuiInset()
  34. end
  35.  
  36. -- // A better round function
  37. -- // Allows for decimal places
  38. function round(value, decimals)
  39.     local multiplier = 1
  40.  
  41.     for i=1,decimals do
  42.         multiplier = multiplier * 10
  43.     end
  44.  
  45.     return math.round(value*multiplier)/multiplier
  46. end
  47.  
  48. -- // Random string generator
  49. local charset = {}  do -- [0-9a-zA-Z]
  50.     for c = 48, 57  do table.insert(charset, string.char(c)) end
  51.     for c = 65, 90  do table.insert(charset, string.char(c)) end
  52.     for c = 97, 122 do table.insert(charset, string.char(c)) end
  53. end
  54.  
  55. function random(length)
  56.     if not length or length <= 0 then return '' end
  57.     math.randomseed(os.clock()^5)
  58.     return random(length - 1) .. charset[math.random(1, #charset)]
  59. end
  60.  
  61. -- // Converts a mouse location to a position within the frame given
  62. function InBounds(frame, mouseX, mouseY)
  63.     if frame == nil then return nil end
  64.  
  65.     local X, Y = mouseX - frame.AbsolutePosition.X, mouseY - frame.AbsolutePosition.Y
  66.     local MaxX, MaxY = frame.AbsoluteSize.X, frame.AbsoluteSize.Y
  67.  
  68.     return X/MaxX, Y/MaxY
  69. end
  70.  
  71. -- // Gives wether a mouse is within a frame
  72. function IsInBounds(frame, mouseX, mouseY)
  73.     if frame == nil then return nil end
  74.  
  75.     local X, Y = InBounds(frame, mouseX, mouseY)
  76.     return X >= 0 and X <= 1 and Y >= 0 and Y <= 1
  77. end
  78.  
  79. -- // Dragging functions
  80. -- // Allows for dragging of frames
  81. function draggable(frame, exclude)
  82.     local tweenInfo = TweenInfo.new(0.37245, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
  83.  
  84.     local dragging
  85.     local dragStart
  86.     local startPos
  87.  
  88.     local function update(input)
  89.         local delta = input.Position - dragStart
  90.         local position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  91.    
  92.         local positionTween = TweenService:Create(frame, tweenInfo, {
  93.             Position = position
  94.         })
  95.         positionTween:Play()
  96.     end
  97.    
  98.     frame.InputBegan:Connect(function(input)
  99.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  100.             if IsInBounds(exclude, input.Position.X, input.Position.Y) then
  101.                 dragging = false
  102.                 return
  103.             end
  104.            
  105.             dragging = true
  106.             dragStart = input.Position
  107.             startPos = frame.Position
  108.    
  109.             input.Changed:Connect(function()
  110.                 if input.UserInputState == Enum.UserInputState.End then
  111.                     dragging = false
  112.                 end
  113.             end)
  114.         end
  115.     end)
  116.    
  117.     UserInputService.InputChanged:Connect(function(input)
  118.         if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and dragging then
  119.             update(input)
  120.         end
  121.     end)
  122.    
  123.     UserInputService.InputEnded:Connect(function(input)
  124.         if dragging then
  125.             dragging = false
  126.         end
  127.     end)
  128. end
  129.  
  130. -- // Create UI
  131. function library:CreateWindow(Text : string)
  132.     -- // Create the main frame's library
  133.     local library = {}
  134.  
  135.     -- // Create the main frame
  136.     local FestivalWare = Instance.new("ScreenGui")
  137.    
  138.     -- // Check if Synapse X is being used
  139.     -- // and if so, protect the frame
  140.     if syn then
  141.         syn.protect_gui(FestivalWare)
  142.     end
  143.  
  144.     -- // Randomise the name of the GUI
  145.     -- // as a minimal form of protection
  146.     FestivalWare.Name = random(16)
  147.  
  148.     -- // Complete the GUI behaviour
  149.     FestivalWare.Parent = CoreGui
  150.     FestivalWare.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  151.  
  152.     -- // Create the base window frame
  153.     local Body = Instance.new("Frame")
  154.     Body.Name = "Body"
  155.     Body.Parent = FestivalWare
  156.     Body.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  157.     Body.BackgroundTransparency = 1.000
  158.     Body.BorderSizePixel = 0
  159.     Body.Position = UDim2.new(0.333857447, 0, 0.298545778, 0)
  160.     Body.Size = UDim2.new(0, 700, 0, 400)
  161.    
  162.     local Background = Instance.new("ImageLabel")
  163.     Background.Name = "Background"
  164.     Background.Parent = Body
  165.     Background.BackgroundColor3 = Color3.fromRGB(36, 36, 36)
  166.     Background.Size = UDim2.new(1, 0, 1, 0)
  167.     Background.Image = "http://www.roblox.com/asset/?id=10865271650"
  168.  
  169.     local Panel = Instance.new("Frame")
  170.     Panel.Name = "Panel"
  171.     Panel.Parent = Body
  172.     Panel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  173.     Panel.BackgroundTransparency = 0.850
  174.     Panel.BorderSizePixel = 0
  175.     Panel.Size = UDim2.new(0, 170, 0, 400)
  176.  
  177.     local Title = Instance.new("TextLabel")
  178.     Title.Name = "Title"
  179.     Title.Parent = Panel
  180.     Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  181.     Title.BackgroundTransparency = 1.000
  182.     Title.BorderSizePixel = 0
  183.     Title.Position = UDim2.new(0.0411764719, 0, 0.0199999996, 0)
  184.     Title.Size = UDim2.new(0, 155, 0, 44)
  185.     Title.Font = Enum.Font.GothamBold
  186.     Title.Text = Text
  187.     Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  188.     Title.TextScaled = true
  189.     Title.TextSize = 32.000
  190.     Title.TextWrapped = true
  191.  
  192.     local Description = Instance.new("TextLabel")
  193.     Description.Name = "Description"
  194.     Description.Parent = Panel
  195.     Description.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  196.     Description.BackgroundTransparency = 1.000
  197.     Description.BorderSizePixel = 0
  198.     Description.Position = UDim2.new(0.0411764719, 0, 0.129999995, 0)
  199.     Description.Size = UDim2.new(0, 155, 0, 20)
  200.     Description.Font = Enum.Font.GothamBold
  201.     Description.Text = "Just exploiting."
  202.     Description.TextColor3 = Color3.fromRGB(220, 220, 220)
  203.     Description.TextSize = 16.000
  204.     Description.TextWrapped = true
  205.     Description.TextYAlignment = Enum.TextYAlignment.Top
  206.  
  207.     local Buttons = Instance.new("ScrollingFrame")
  208.     Buttons.Name = "Buttons"
  209.     Buttons.Parent = Panel
  210.     Buttons.Active = true
  211.     Buttons.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  212.     Buttons.BackgroundTransparency = 0.800
  213.     Buttons.BorderSizePixel = 0
  214.     Buttons.Position = UDim2.new(0.0411764719, 0, 0.197500005, 0)
  215.     Buttons.Size = UDim2.new(0, 155, 0, 267)
  216.     Buttons.ScrollBarThickness = 0
  217.     Buttons.CanvasSize = UDim2.new(0, 0, 0, 0)
  218.  
  219.     local UIListLayout = Instance.new("UIListLayout")
  220.     UIListLayout.Parent = Buttons
  221.     UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  222.     UIListLayout.Padding = UDim.new(0, 0)
  223.  
  224.     local UserInformation = Instance.new("Frame")
  225.     UserInformation.Name = "UserInformation"
  226.     UserInformation.Parent = Panel
  227.     UserInformation.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  228.     UserInformation.BackgroundTransparency = 0.800
  229.     UserInformation.BorderSizePixel = 0
  230.     UserInformation.Position = UDim2.new(0.0411764719, 0, 0.887499988, 0)
  231.     UserInformation.Size = UDim2.new(0, 155, 0, 37)
  232.  
  233.     local ProfileImage, ProfileIsReady = Players:GetUserThumbnailAsync(LocalPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
  234.  
  235.     repeat
  236.         warn("Waiting for profile image to load...")
  237.         wait()
  238.     until ProfileIsReady
  239.  
  240.     local Profile = Instance.new("ImageLabel")
  241.     Profile.Name = "Profile"
  242.     Profile.Parent = UserInformation
  243.     Profile.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  244.     Profile.BackgroundTransparency = 0.600
  245.     Profile.BorderSizePixel = 0
  246.     Profile.Position = UDim2.new(0.045161292, 0, 0.108108111, 0)
  247.     Profile.Size = UDim2.new(0, 28, 0, 28)
  248.     Profile.Image = ProfileImage
  249.  
  250.     local UICorner = Instance.new("UICorner")
  251.     UICorner.CornerRadius = UDim.new(1, 0)
  252.     UICorner.Parent = Profile
  253.  
  254.     local Username = Instance.new("TextLabel")
  255.     Username.Name = "Username"
  256.     Username.Parent = UserInformation
  257.     Username.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  258.     Username.BackgroundTransparency = 1.000
  259.     Username.BorderSizePixel = 0
  260.     Username.Position = UDim2.new(0.283870965, 0, 0.108108111, 0)
  261.     Username.Size = UDim2.new(0, 92, 0, 28)
  262.     Username.Font = Enum.Font.Gotham
  263.     Username.Text = LocalPlayer.Name
  264.     Username.TextColor3 = Color3.fromRGB(223, 223, 223)
  265.     Username.TextScaled = true
  266.     Username.TextSize = 14.000
  267.     Username.TextWrapped = true
  268.  
  269.     local Menu = Instance.new("Frame")
  270.     Menu.Name = "Menu"
  271.     Menu.Parent = Body
  272.     Menu.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  273.     Menu.BackgroundTransparency = 0.800
  274.     Menu.BorderSizePixel = 0
  275.     Menu.Position = UDim2.new(0.254285723, 0, 0.0299999993, 0)
  276.     Menu.Size = UDim2.new(0, 509, 0, 380)
  277.  
  278.     local UIScale = Instance.new("UIScale")
  279.     UIScale.Parent = Body
  280.  
  281.     -- // Create the notifications frame
  282.     local Notifications = Instance.new("Frame")
  283.     Notifications.Name = "Notifications"
  284.     Notifications.Parent = FestivalWare
  285.     Notifications.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  286.     Notifications.BackgroundTransparency = 1.000
  287.     Notifications.BorderSizePixel = 0
  288.     Notifications.Size = UDim2.new(1, 0, 0.980000019, 0)
  289.  
  290.     local UIListLayout_1 = Instance.new("UIListLayout")
  291.     UIListLayout_1.Parent = Notifications
  292.     UIListLayout_1.HorizontalAlignment = Enum.HorizontalAlignment.Right
  293.     UIListLayout_1.SortOrder = Enum.SortOrder.LayoutOrder
  294.     UIListLayout_1.VerticalAlignment = Enum.VerticalAlignment.Bottom
  295.     UIListLayout_1.Padding = UDim.new(0, 5)
  296.  
  297.     local UIScale_1 = Instance.new("UIScale")
  298.     UIScale_1.Parent = Notifications
  299.    
  300.     -- // Functions
  301.     local index = 0
  302.     function library:CreateTab(TabText: string)
  303.         local firstTab = false
  304.        
  305.         -- // Check if there is a tab already
  306.         if index == 0 then
  307.             firstTab = true
  308.         end
  309.         index = index + 1
  310.  
  311.         -- // Create the tabs's library
  312.         local library = {}
  313.  
  314.         -- // Create the tab button    
  315.         local Button = Instance.new("TextButton")
  316.         Button.Name = TabText
  317.         Button.Parent = Buttons
  318.         Button.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  319.         Button.BackgroundTransparency = 1.000
  320.         Button.BorderSizePixel = 0
  321.         Button.Size = UDim2.new(0, 155, 0, 31)
  322.         Button.Font = Enum.Font.Gotham
  323.         Button.Text = TabText
  324.         Button.TextColor3 = Color3.fromRGB(211, 211, 211)
  325.         Button.TextSize = 14.000
  326.  
  327.         -- // Extend the tab area
  328.         Buttons.CanvasSize = Buttons.CanvasSize + UDim2.new(0, 0, 0, 31)
  329.  
  330.         -- // Create the tab panel
  331.         local Frame = Instance.new("ScrollingFrame")
  332.         Frame.Name = "Frame"
  333.         Frame.Parent = Menu
  334.         Frame.Active = true
  335.         Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  336.         Frame.BackgroundTransparency = 1.000
  337.         Frame.BorderSizePixel = 0
  338.         Frame.CanvasSize = UDim2.new(0, 0, 0, 0)
  339.         Frame.Size = UDim2.new(0, 508, 0, 375)
  340.         Frame.ScrollBarThickness = 0
  341.         Frame.Visible = firstTab
  342.  
  343.         -- // Create the tab's UIListLayout
  344.         local UIListLayout = Instance.new("UIListLayout")
  345.         UIListLayout.Parent = Frame
  346.         UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  347.         UIListLayout.Padding = UDim.new(0, 0)
  348.  
  349.         -- // Create the tab's UIPadding
  350.         local UIPadding = Instance.new("UIPadding")
  351.         UIPadding.Parent = Frame
  352.         UIPadding.PaddingLeft = UDim.new(0, 5)
  353.         UIPadding.PaddingRight = UDim.new(0, 5)
  354.         UIPadding.PaddingTop = UDim.new(0, 5)
  355.         UIPadding.PaddingBottom = UDim.new(0, 5)
  356.  
  357.         -- // Functions
  358.         -- // Label
  359.         function library:CreateLabel(Text: string)
  360.             -- // Create the elements's library
  361.             local element_library = {}
  362.  
  363.             -- // Create the label
  364.             local Label = Instance.new("Frame")
  365.             Label.Name = "Label"
  366.             Label.Parent = Frame
  367.             Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  368.             Label.BackgroundTransparency = 1.000
  369.             Label.BorderSizePixel = 0
  370.             Label.Size = UDim2.new(0, 496, 0, 42)
  371.  
  372.             local TextLabel = Instance.new("TextLabel")
  373.             TextLabel.Parent = Label
  374.             TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  375.             TextLabel.BackgroundTransparency = 1.000
  376.             TextLabel.BorderSizePixel = 0
  377.             TextLabel.ClipsDescendants = true
  378.             TextLabel.Size = UDim2.new(1, 0, 1, 0)
  379.             TextLabel.Font = Enum.Font.GothamBold
  380.             TextLabel.Text = Text
  381.             TextLabel.TextColor3 = Color3.fromRGB(230, 230, 230)
  382.             TextLabel.TextSize = 32.000
  383.  
  384.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  385.  
  386.             -- // Functions
  387.             function element_library:SetText(Text: string)
  388.                 TextLabel.Text = Text
  389.             end
  390.  
  391.             function element_library:GetText()
  392.                 return TextLabel.Text
  393.             end
  394.  
  395.             function element_library:Destroy()
  396.                 Label:Destroy()
  397.             end
  398.  
  399.             -- // Return the element's library
  400.             return element_library
  401.         end
  402.  
  403.         -- // Button
  404.         function library:CreateButton(Text: string, Callback)
  405.             -- // Create the elements's library
  406.             local element_library = {}
  407.  
  408.             -- // Create the button
  409.             local Button = Instance.new("Frame")
  410.             Button.Name = "Button"
  411.             Button.Parent = Frame
  412.             Button.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  413.             Button.BackgroundTransparency = 1.000
  414.             Button.Size = UDim2.new(0, 496, 0, 42)
  415.  
  416.             local Button_1 = Instance.new("TextButton")
  417.             Button_1.Parent = Button
  418.             Button_1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  419.             Button_1.BackgroundTransparency = 1.000
  420.             Button_1.BorderSizePixel = 0
  421.             Button_1.ClipsDescendants = true
  422.             Button_1.Size = UDim2.new(1, 0, 1, 0)
  423.             Button_1.Font = Enum.Font.SourceSans
  424.             Button_1.Text = ""
  425.             Button_1.TextColor3 = Color3.fromRGB(0, 0, 0)
  426.             Button_1.TextSize = 14.000
  427.  
  428.             local Background = Instance.new("Frame")
  429.             Background.Name = "Background"
  430.             Background.Parent = Button_1
  431.             Background.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  432.             Background.BackgroundTransparency = 0.800
  433.             Background.BorderSizePixel = 0
  434.             Background.Size = UDim2.new(1, 0, 1, 0)
  435.  
  436.             local Container = Instance.new("Frame")
  437.             Container.Name = "Container"
  438.             Container.Parent = Background
  439.             Container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  440.             Container.BackgroundTransparency = 0.800
  441.             Container.BorderSizePixel = 0
  442.             Container.Size = UDim2.new(1, 0, 1, 0)
  443.  
  444.             local Label = Instance.new("TextLabel")
  445.             Label.Parent = Button_1
  446.             Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  447.             Label.BackgroundTransparency = 1.000
  448.             Label.BorderSizePixel = 0
  449.             Label.Size = UDim2.new(1, 0, 1, 0)
  450.             Label.Font = Enum.Font.GothamMedium
  451.             Label.Text = Text
  452.             Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  453.             Label.TextSize = 18.000
  454.             Label.TextWrapped = true
  455.  
  456.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  457.  
  458.             -- // Run the script
  459.             local active = false
  460.             local hovering = false
  461.            
  462.             local circleColour = Color3.fromRGB(53, 53, 53)
  463.            
  464.             local function CreateCircle()
  465.                 local circle = Instance.new("Frame")
  466.                 local cornerRadius = Instance.new("UICorner")
  467.            
  468.                 circle.AnchorPoint = Vector2.new(0.5, 0.5)
  469.                 circle.BackgroundColor3 = circleColour
  470.                 circle.Size = UDim2.new(0, 0, 0, 0)
  471.            
  472.                 cornerRadius.CornerRadius = UDim.new(0.5, 0)
  473.                 cornerRadius.Parent = circle
  474.            
  475.                 return circle
  476.             end
  477.            
  478.             local function CalculateDistance(pointA, pointB)
  479.                 return math.sqrt(((pointB.X - pointA.X) ^ 2) + ((pointB.Y - pointA.Y) ^ 2))
  480.             end
  481.            
  482.             local function OnMouseButton1Down()
  483.                 active = true
  484.                
  485.                 if Callback ~= nil then
  486.                     Callback()
  487.                 end
  488.            
  489.                 local buttonAbsoluteSize = Button_1.AbsoluteSize
  490.                 local buttonAbsolutePosition = Button_1.AbsolutePosition
  491.            
  492.                 local mouseAbsolutePosition = Vector2.new(Mouse.X, Mouse.Y)
  493.                 local mouseRelativePosition = (mouseAbsolutePosition - buttonAbsolutePosition)
  494.                
  495.                 local circle = CreateCircle()
  496.                 circle.BackgroundTransparency = 0.84
  497.                 circle.Position = UDim2.new(0, mouseRelativePosition.X, 0, mouseRelativePosition.Y)
  498.                 circle.Parent = Container
  499.            
  500.                 local topLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, 0))
  501.                 local topRight = CalculateDistance(mouseRelativePosition, Vector2.new(buttonAbsoluteSize.X, 0))
  502.                 local bottomRight = CalculateDistance(mouseRelativePosition, buttonAbsoluteSize)
  503.                 local bottomLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, buttonAbsoluteSize.Y))
  504.                 local size = math.max(topLeft, topRight, bottomRight, bottomLeft) * 2
  505.            
  506.                 local tweenTime = 0.5
  507.                 local startedTimestamp
  508.                 local completed = false
  509.            
  510.                 local expand = TweenService:Create(circle, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  511.                     Size = UDim2.new(0, size, 0, size)
  512.                 })
  513.            
  514.                 local connection
  515.                 connection = RunService.RenderStepped:Connect(function()
  516.                     if not active then
  517.                         connection:Disconnect()
  518.            
  519.                         local defaultTime = tweenTime/3
  520.                         local timeRemaining = tweenTime - (os.time() - startedTimestamp)
  521.                         local newTweenTime = not completed and timeRemaining > defaultTime and timeRemaining or defaultTime
  522.            
  523.                         local fadeOut = TweenService:Create(circle, TweenInfo.new(newTweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  524.                             BackgroundTransparency = 1
  525.                         })
  526.            
  527.                         fadeOut:Play()
  528.                         fadeOut.Completed:Wait()
  529.                         circle:Destroy()
  530.                     end
  531.                 end)
  532.            
  533.                 expand:Play()
  534.                 startedTimestamp = os.time()
  535.                 expand.Completed:Wait()
  536.            
  537.                 completed = true
  538.             end
  539.            
  540.             local function OnMouseButton1Up()
  541.                 active = false
  542.             end
  543.            
  544.             local function OnMouseEnter()
  545.                 hovering = true
  546.            
  547.                 local tweenTime = 0.125
  548.                 local tweenInfo =
  549.                     TweenInfo.new(tweenTime,
  550.                         Enum.EasingStyle.Linear,
  551.                         Enum.EasingDirection.Out)
  552.            
  553.                 local backgroundFadeIn = TweenService:Create(Container, tweenInfo, {
  554.                     BackgroundTransparency = 0.95
  555.                 })
  556.                 backgroundFadeIn:Play()
  557.                 backgroundFadeIn.Completed:Wait()
  558.            
  559.                 local backgroundFadeOut = TweenService:Create(Container, tweenInfo, {
  560.                     BackgroundTransparency = 1
  561.                 })
  562.                 repeat wait() until not hovering
  563.                 backgroundFadeOut:Play()
  564.             end
  565.            
  566.             local function OnMouseLeave()
  567.                 hovering = false
  568.                 active = false
  569.             end
  570.            
  571.             Button_1.MouseButton1Down:Connect(OnMouseButton1Down)
  572.             Button_1.MouseButton1Up:Connect(OnMouseButton1Up)
  573.            
  574.             Button_1.MouseEnter:Connect(OnMouseEnter)
  575.             Button_1.MouseLeave:Connect(OnMouseLeave)
  576.  
  577.             -- // Functions
  578.             function element_library:Call()
  579.                 if Callback ~= nil then
  580.                     Callback()
  581.                 end
  582.             end
  583.  
  584.             function element_library:SetText(Text: string)
  585.                 Label.Text = Text
  586.             end
  587.  
  588.             function element_library:GetText()
  589.                 return Label.Text
  590.             end
  591.  
  592.             function element_library:Destroy()
  593.                 Button:Destroy()
  594.             end
  595.  
  596.             -- // Return the element's library
  597.             return element_library
  598.         end
  599.  
  600.         -- // Toggle
  601.         function library:CreateCheckbox(Text: string, Callback)
  602.             -- // Create the element's library
  603.             local element_library = {}
  604.  
  605.             -- // Create the toggle
  606.             local Toggle = Instance.new("Frame")
  607.             Toggle.Name = "Toggle"
  608.             Toggle.Parent = Frame
  609.             Toggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  610.             Toggle.BackgroundTransparency = 1.000
  611.             Toggle.Size = UDim2.new(0, 496, 0, 42)
  612.  
  613.             local Toggle_1 = Instance.new("TextButton")
  614.             Toggle_1.Parent = Toggle
  615.             Toggle_1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  616.             Toggle_1.BackgroundTransparency = 1.000
  617.             Toggle_1.BorderSizePixel = 0
  618.             Toggle_1.ClipsDescendants = true
  619.             Toggle_1.Size = UDim2.new(1, 0, 1, 0)
  620.             Toggle_1.Font = Enum.Font.SourceSans
  621.             Toggle_1.Text = ""
  622.             Toggle_1.TextColor3 = Color3.fromRGB(0, 0, 0)
  623.             Toggle_1.TextSize = 14.000
  624.  
  625.             local Background = Instance.new("Frame")
  626.             Background.Name = "Background"
  627.             Background.Parent = Toggle_1
  628.             Background.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  629.             Background.BackgroundTransparency = 0.800
  630.             Background.BorderSizePixel = 0
  631.             Background.Size = UDim2.new(1, 0, 1, 0)
  632.            
  633.             local Container = Instance.new("Frame")
  634.             Container.Name = "Container"
  635.             Container.Parent = Background
  636.             Container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  637.             Container.BackgroundTransparency = 0.800
  638.             Container.BorderSizePixel = 0
  639.             Container.Size = UDim2.new(1, 0, 1, 0)
  640.            
  641.             local Toggle_2 = Instance.new("Frame")
  642.             Toggle_2.Name = "Checkbox"
  643.             Toggle_2.Parent = Background
  644.             Toggle_2.BackgroundColor3 = Color3.fromRGB(16, 244, 16)
  645.             Toggle_2.BackgroundTransparency = 0.600
  646.             Toggle_2.BorderSizePixel = 0
  647.             Toggle_2.Position = UDim2.new(0.0141129028, 0, 0.238095239, 0)
  648.             Toggle_2.Size = UDim2.new(0.125, 0, 0.5, 0)
  649.            
  650.             local Toggle_3 = Instance.new("TextButton")
  651.             Toggle_3.Parent = Toggle_2
  652.             Toggle_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  653.             Toggle_3.BackgroundTransparency = 0.600
  654.             Toggle_3.BorderSizePixel = 0
  655.             Toggle_3.Position = UDim2.new(0.0500000007, 0, -0.075000003, 0)
  656.             Toggle_3.Size = UDim2.new(0.5, 0, 1.20000005, 0)
  657.             Toggle_3.Font = Enum.Font.SourceSans
  658.             Toggle_3.Text = ""
  659.             Toggle_3.TextColor3 = Color3.fromRGB(0, 0, 0)
  660.             Toggle_3.TextSize = 14.000
  661.            
  662.             local Label = Instance.new("TextLabel")
  663.             Label.Parent = Toggle_1
  664.             Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  665.             Label.BackgroundTransparency = 1.000
  666.             Label.BorderSizePixel = 0
  667.             Label.Size = UDim2.new(1, 0, 1, 0)
  668.             Label.Font = Enum.Font.GothamMedium
  669.             Label.Text = Text
  670.             Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  671.             Label.TextSize = 18.000
  672.             Label.TextWrapped = true
  673.  
  674.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  675.  
  676.             -- // Run the script
  677.             local active = false
  678.             local hovering = false
  679.             local toggled = false
  680.  
  681.             local circleColour = Color3.fromRGB(53, 53, 53)
  682.             local red = Color3.fromRGB(244, 16, 16)
  683.             local green = Color3.fromRGB(16, 244, 16)
  684.  
  685.             local function UpdateCheckbox()
  686.                 local position
  687.                 local colour
  688.                
  689.                 if toggled then
  690.                     position = UDim2.new(0.45, Toggle_2.TextButton.Position.X.Offset, Toggle_2.TextButton.Position.Y.Scale, Toggle_2.TextButton.Position.Y.Offset)
  691.                     colour = green
  692.                 else
  693.                     position = UDim2.new(0.05, Toggle_2.TextButton.Position.X.Offset, Toggle_2.TextButton.Position.Y.Scale, Toggle_2.TextButton.Position.Y.Offset)
  694.                     colour = red
  695.                 end
  696.  
  697.                 local tweenTime = 0.25
  698.                 local checkboxToggle = TweenService:Create(Toggle_2.TextButton, TweenInfo.new(tweenTime, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
  699.                     Position = position
  700.                 })
  701.                 local checkboxColour = TweenService:Create(Toggle_2, TweenInfo.new(tweenTime, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
  702.                     BackgroundColor3 = colour
  703.                 })
  704.                 checkboxToggle:Play()
  705.                 checkboxColour:Play()
  706.             end
  707.  
  708.             local function CreateCircle()
  709.                 local circle = Instance.new("Frame")
  710.                 local cornerRadius = Instance.new("UICorner")
  711.  
  712.                 circle.AnchorPoint = Vector2.new(0.5, 0.5)
  713.                 circle.BackgroundColor3 = circleColour
  714.                 circle.Size = UDim2.new(0, 0, 0, 0)
  715.  
  716.                 cornerRadius.CornerRadius = UDim.new(0.5, 0)
  717.                 cornerRadius.Parent = circle
  718.  
  719.                 return circle
  720.             end
  721.  
  722.             local function CalculateDistance(pointA, pointB)
  723.                 return math.sqrt(((pointB.X - pointA.X) ^ 2) + ((pointB.Y - pointA.Y) ^ 2))
  724.             end
  725.  
  726.             local function OnMouseButton1Down()
  727.                 active = true
  728.                
  729.                 if toggled then
  730.                     toggled = false
  731.                 else
  732.                     toggled = true
  733.                 end
  734.                
  735.                 UpdateCheckbox()
  736.                 if Callback ~= nil then
  737.                     Callback(toggled)
  738.                 end
  739.  
  740.                 local buttonAbsoluteSize = Toggle_1.AbsoluteSize
  741.                 local buttonAbsolutePosition = Toggle_1.AbsolutePosition
  742.  
  743.                 local mouseAbsolutePosition = Vector2.new(Mouse.X, Mouse.Y)
  744.                 local mouseRelativePosition = (mouseAbsolutePosition - buttonAbsolutePosition)
  745.  
  746.                 local circle = CreateCircle()
  747.                 circle.BackgroundTransparency = 0.84
  748.                 circle.Position = UDim2.new(0, mouseRelativePosition.X, 0, mouseRelativePosition.Y)
  749.                 circle.Parent = Container
  750.  
  751.                 local topLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, 0))
  752.                 local topRight = CalculateDistance(mouseRelativePosition, Vector2.new(buttonAbsoluteSize.X, 0))
  753.                 local bottomRight = CalculateDistance(mouseRelativePosition, buttonAbsoluteSize)
  754.                 local bottomLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, buttonAbsoluteSize.Y))
  755.                 local size = math.max(topLeft, topRight, bottomRight, bottomLeft) * 2
  756.  
  757.                 local tweenTime = 0.5
  758.                 local startedTimestamp
  759.                 local completed = false
  760.  
  761.                 local expand = TweenService:Create(circle, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  762.                     Size = UDim2.new(0, size, 0, size)
  763.                 })
  764.  
  765.                 local connection
  766.                 connection = RunService.RenderStepped:Connect(function()
  767.                     if not active then
  768.                         connection:Disconnect()
  769.  
  770.                         local defaultTime = tweenTime/3
  771.                         local timeRemaining = tweenTime - (os.time() - startedTimestamp)
  772.                         local newTweenTime = not completed and timeRemaining > defaultTime and timeRemaining or defaultTime
  773.  
  774.                         local fadeOut = TweenService:Create(circle, TweenInfo.new(newTweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  775.                             BackgroundTransparency = 1
  776.                         })
  777.  
  778.                         fadeOut:Play()
  779.                         fadeOut.Completed:Wait()
  780.                         circle:Destroy()
  781.                     end
  782.                 end)
  783.  
  784.                 expand:Play()
  785.                 startedTimestamp = os.time()
  786.                 expand.Completed:Wait()
  787.  
  788.                 completed = true
  789.             end
  790.  
  791.             local function OnMouseButton1Up()
  792.                 active = false
  793.             end
  794.  
  795.             local function OnMouseEnter()
  796.                 hovering = true
  797.  
  798.                 local tweenTime = 0.125
  799.                 local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  800.  
  801.                 local backgroundFadeIn = TweenService:Create(Container, tweenInfo, {
  802.                     BackgroundTransparency = 0.95
  803.                 })
  804.                 backgroundFadeIn:Play()
  805.                 backgroundFadeIn.Completed:Wait()
  806.  
  807.                 local backgroundFadeOut = TweenService:Create(Container, tweenInfo, {
  808.                     BackgroundTransparency = 1
  809.                 })
  810.                 repeat wait() until not hovering
  811.                 backgroundFadeOut:Play()
  812.             end
  813.  
  814.             local function OnMouseLeave()
  815.                 hovering = false
  816.                 active = false
  817.             end
  818.  
  819.             UpdateCheckbox()
  820.  
  821.             Toggle_2.TextButton.MouseButton1Down:Connect(OnMouseButton1Down)
  822.             Toggle_2.TextButton.MouseButton1Up:Connect(OnMouseButton1Up)
  823.             Toggle_1.MouseButton1Down:Connect(OnMouseButton1Down)
  824.             Toggle_1.MouseButton1Up:Connect(OnMouseButton1Up)
  825.  
  826.             Toggle_2.TextButton.MouseEnter:Connect(OnMouseEnter)
  827.             Toggle_2.TextButton.MouseLeave:Connect(OnMouseLeave)
  828.             Toggle_1.MouseEnter:Connect(OnMouseEnter)
  829.             Toggle_1.MouseLeave:Connect(OnMouseLeave)
  830.  
  831.             -- // Functions
  832.             function element_library:Toggle()
  833.                 toggled = not toggled
  834.                 UpdateCheckbox()
  835.                 if Callback ~= nil then
  836.                     Callback(toggled)
  837.                 end
  838.             end
  839.  
  840.             function element_library:SetState(state)
  841.                 toggled = state
  842.                 UpdateCheckbox()
  843.                 if Callback ~= nil then
  844.                     Callback(toggled)
  845.                 end
  846.             end
  847.  
  848.             function element_library:GetState()
  849.                 return toggled
  850.             end
  851.  
  852.             function element_library:SetText(Text: string)
  853.                 Label.Text = Text
  854.             end
  855.  
  856.             function element_library:GetText()
  857.                 return Label.Text
  858.             end
  859.  
  860.             function element_library:Destroy()
  861.                 Toggle:Destroy()
  862.             end
  863.  
  864.             -- // Return the element's library
  865.             return element_library
  866.         end
  867.  
  868.         -- // Slider
  869.         function library:CreateSlider(Text: string, From: number, To: number, Decimals: number, Callback)
  870.             -- // Create the element's library
  871.             local element_library = {}
  872.  
  873.             -- // Create the slider
  874.             local Slider = Instance.new("Frame")
  875.             Slider.Name = "Slider"
  876.             Slider.Parent = Frame
  877.             Slider.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  878.             Slider.BackgroundTransparency = 1.000
  879.             Slider.Size = UDim2.new(0, 496, 0, 42)
  880.  
  881.             local Slider_1 = Instance.new("TextButton")
  882.             Slider_1.Parent = Slider
  883.             Slider_1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  884.             Slider_1.BackgroundTransparency = 1.000
  885.             Slider_1.BorderSizePixel = 0
  886.             Slider_1.ClipsDescendants = true
  887.             Slider_1.Size = UDim2.new(1, 0, 1, 0)
  888.             Slider_1.Font = Enum.Font.SourceSans
  889.             Slider_1.Text = ""
  890.             Slider_1.TextColor3 = Color3.fromRGB(0, 0, 0)
  891.             Slider_1.TextSize = 14.000
  892.  
  893.             local Background = Instance.new("Frame")
  894.             Background.Name = "Background"
  895.             Background.Parent = Slider_1
  896.             Background.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  897.             Background.BackgroundTransparency = 0.800
  898.             Background.BorderSizePixel = 0
  899.             Background.Size = UDim2.new(1, 0, 1, 0)
  900.  
  901.             local Container = Instance.new("Frame")
  902.             Container.Name = "Container"
  903.             Container.Parent = Background
  904.             Container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  905.             Container.BackgroundTransparency = 0.800
  906.             Container.BorderSizePixel = 0
  907.             Container.Size = UDim2.new(1, 0, 1, 0)
  908.  
  909.             local Slider_2 = Instance.new("Frame")
  910.             Slider_2.Name = "Slider"
  911.             Slider_2.Parent = Background
  912.             Slider_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  913.             Slider_2.BackgroundTransparency = 1.000
  914.             Slider_2.Position = UDim2.new(0.0500000007, 0, 1, -2)
  915.             Slider_2.Size = UDim2.new(0.899999976, 0, 0, 2)
  916.  
  917.             local Slider_3 = Instance.new("TextButton")
  918.             Slider_3.Name = "Slider"
  919.             Slider_3.Parent = Slider_2
  920.             Slider_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  921.             Slider_3.Size = UDim2.new(1, 0, 1, 0)
  922.             Slider_3.Font = Enum.Font.SourceSans
  923.             Slider_3.Text = ""
  924.             Slider_3.TextColor3 = Color3.fromRGB(0, 0, 0)
  925.             Slider_3.TextSize = 14.000
  926.  
  927.             local UIGradient = Instance.new("UIGradient")
  928.             UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(131, 131, 131)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(236, 236, 236))}
  929.             UIGradient.Parent = Slider_3
  930.  
  931.             local Label = Instance.new("TextLabel")
  932.             Label.Parent = Slider_1
  933.             Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  934.             Label.BackgroundTransparency = 1.000
  935.             Label.BorderSizePixel = 0
  936.             Label.Size = UDim2.new(1, 0, 1, 0)
  937.             Label.Font = Enum.Font.GothamMedium
  938.             Label.Text = Text
  939.             Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  940.             Label.TextSize = 18.000
  941.             Label.TextWrapped = true
  942.  
  943.             local Values = Instance.new("Frame")
  944.             Values.Name = "Values"
  945.             Values.Parent = Slider_1
  946.             Values.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  947.             Values.BackgroundTransparency = 1.000
  948.             Values.BorderSizePixel = 0
  949.             Values.Size = UDim2.new(1, 0, 1, 0)
  950.  
  951.             local Minimum = Instance.new("TextLabel")
  952.             Minimum.Name = "Minimum"
  953.             Minimum.Parent = Values
  954.             Minimum.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  955.             Minimum.BackgroundTransparency = 1.000
  956.             Minimum.BorderSizePixel = 0
  957.             Minimum.Position = UDim2.new(0.0487902761, 0, 0.333333343, 0)
  958.             Minimum.Size = UDim2.new(0.106451713, 0, 0.666666687, 0)
  959.             Minimum.Font = Enum.Font.Gotham
  960.             Minimum.Text = "0"
  961.             Minimum.TextColor3 = Color3.fromRGB(236, 236, 236)
  962.             Minimum.TextSize = 18.000
  963.             Minimum.TextWrapped = true
  964.             Minimum.TextXAlignment = Enum.TextXAlignment.Left
  965.  
  966.             local Current = Instance.new("TextLabel")
  967.             Current.Name = "Current"
  968.             Current.Parent = Values
  969.             Current.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  970.             Current.BackgroundTransparency = 1.000
  971.             Current.BorderSizePixel = 0
  972.             Current.Position = UDim2.new(0.843145132, 0, 0.333333343, 0)
  973.             Current.Size = UDim2.new(0.106451713, 0, 0.666666687, 0)
  974.             Current.Font = Enum.Font.Gotham
  975.             Current.Text = ""
  976.             Current.TextColor3 = Color3.fromRGB(236, 236, 236)
  977.             Current.TextSize = 18.000
  978.             Current.TextWrapped = true
  979.             Current.TextXAlignment = Enum.TextXAlignment.Right
  980.  
  981.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  982.  
  983.             -- // Run the script
  984.             local active = false
  985.             local hovering = false
  986.            
  987.             local from = From
  988.             local to = To
  989.             local percentage = 0.5
  990.  
  991.             Current.Text = From + ((To - From) * percentage)
  992.            
  993.             local circleColour = Color3.fromRGB(53, 53, 53)
  994.            
  995.             local function UpdateSlider()
  996.                 if not active then
  997.                     return
  998.                 end
  999.            
  1000.                 local mousePosition = GetMouseLocation()
  1001.                 local relativePosition = mousePosition - Slider_3.AbsolutePosition
  1002.            
  1003.                 percentage = math.clamp(relativePosition.X/Slider_1.AbsoluteSize.X, 0, 0.9) * (1/0.9)
  1004.                 local size = UDim2.new(percentage, Slider_2.Size.X.Offset, Slider_2.Size.Y.Scale, Slider_2.Size.Y.Offset)
  1005.            
  1006.                 local sizeTween = TweenService:Create(Slider_3, TweenInfo.new(0.15, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
  1007.                     Size = size
  1008.                 })
  1009.                 sizeTween:Play()
  1010.                
  1011.                 Slider_1.Values.Current.Text = from + ((to - from) * percentage)
  1012.             end
  1013.            
  1014.             local function CreateCircle()
  1015.                 local circle = Instance.new("Frame")
  1016.                 local cornerRadius = Instance.new("UICorner")
  1017.            
  1018.                 circle.AnchorPoint = Vector2.new(0.5, 0.5)
  1019.                 circle.BackgroundColor3 = circleColour
  1020.                 circle.Size = UDim2.new(0, 0, 0, 0)
  1021.            
  1022.                 cornerRadius.CornerRadius = UDim.new(0.5, 0)
  1023.                 cornerRadius.Parent = circle
  1024.            
  1025.                 return circle
  1026.             end
  1027.            
  1028.             local function CalculateDistance(pointA, pointB)
  1029.                 return math.sqrt(((pointB.X - pointA.X) ^ 2) + ((pointB.Y - pointA.Y) ^ 2))
  1030.             end
  1031.            
  1032.             local function OnMouseButton1Down()
  1033.                 active = true
  1034.                
  1035.                 local buttonAbsoluteSize = Slider_1.AbsoluteSize
  1036.                 local buttonAbsolutePosition = Slider_1.AbsolutePosition
  1037.            
  1038.                 local mouseAbsolutePosition = Vector2.new(Mouse.X, Mouse.Y)
  1039.                 local mouseRelativePosition = (mouseAbsolutePosition - buttonAbsolutePosition)
  1040.            
  1041.                 local circle = CreateCircle()
  1042.                 circle.BackgroundTransparency = 0.84
  1043.                 circle.Position = UDim2.new(0, mouseRelativePosition.X, 0, mouseRelativePosition.Y)
  1044.                 circle.Parent = Container
  1045.            
  1046.                 local topLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, 0))
  1047.                 local topRight = CalculateDistance(mouseRelativePosition, Vector2.new(buttonAbsoluteSize.X, 0))
  1048.                 local bottomRight = CalculateDistance(mouseRelativePosition, buttonAbsoluteSize)
  1049.                 local bottomLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, buttonAbsoluteSize.Y))
  1050.                 local size = math.max(topLeft, topRight, bottomRight, bottomLeft) * 2
  1051.            
  1052.                 local tweenTime = 0.5
  1053.                 local startedTimestamp
  1054.                 local completed = false
  1055.            
  1056.                 UpdateSlider()
  1057.            
  1058.                 local expand = TweenService:Create(circle, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1059.                     Size = UDim2.new(0, size, 0, size)
  1060.                 })
  1061.            
  1062.                 local connection
  1063.                 connection = RunService.RenderStepped:Connect(function()
  1064.                     if not active then
  1065.                         connection:Disconnect()
  1066.            
  1067.                         local defaultTime = tweenTime/3
  1068.                         local timeRemaining = tweenTime - (os.time() - startedTimestamp)
  1069.                         local newTweenTime = not completed and timeRemaining > defaultTime and timeRemaining or defaultTime
  1070.            
  1071.                         local fadeOut = TweenService:Create(circle, TweenInfo.new(newTweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1072.                             BackgroundTransparency = 1
  1073.                         })
  1074.            
  1075.                         fadeOut:Play()
  1076.                         fadeOut.Completed:Wait()
  1077.                         circle:Destroy()
  1078.                     end
  1079.                 end)
  1080.            
  1081.                 expand:Play()
  1082.                 startedTimestamp = os.time()
  1083.                 expand.Completed:Wait()
  1084.            
  1085.                 completed = true
  1086.             end
  1087.            
  1088.             local function OnMouseButton1Up()
  1089.                 active = false
  1090.                 UpdateSlider()
  1091.             end
  1092.            
  1093.             local function OnMouseEnter()
  1094.                 hovering = true
  1095.            
  1096.                 local tweenTime = 0.125
  1097.                 local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  1098.            
  1099.                 UpdateSlider()
  1100.                
  1101.                 local backgroundFadeIn = TweenService:Create(Container, tweenInfo, {
  1102.                     BackgroundTransparency = 0.95
  1103.                 })
  1104.                 backgroundFadeIn:Play()
  1105.                 backgroundFadeIn.Completed:Wait()
  1106.            
  1107.                 local backgroundFadeOut = TweenService:Create(Container, tweenInfo, {
  1108.                     BackgroundTransparency = 1
  1109.                 })
  1110.                
  1111.                 repeat
  1112.                     wait()
  1113.                 until not hovering
  1114.                 backgroundFadeOut:Play()
  1115.             end
  1116.            
  1117.             local function OnMouseMove()
  1118.                 UpdateSlider()
  1119.             end
  1120.            
  1121.             local function OnMouseLeave()
  1122.                 if Callback ~= nil then
  1123.                     Callback(from + ((to - from) * percentage))
  1124.                 end
  1125.  
  1126.                 UpdateSlider()
  1127.                 hovering = false
  1128.                 active = false
  1129.             end
  1130.            
  1131.             Slider_1.MouseButton1Down:Connect(OnMouseButton1Down)
  1132.             Slider_1.MouseButton1Up:Connect(OnMouseButton1Up)
  1133.            
  1134.             Slider_1.MouseEnter:Connect(OnMouseEnter)
  1135.            
  1136.             UserInputService.InputChanged:Connect(OnMouseMove)
  1137.             UserInputService.InputEnded:Connect(OnMouseLeave)
  1138.  
  1139.             -- // Functions
  1140.             function element_library:SetPercentage(Percentage: number)
  1141.                 percentage = math.clamp(Percentage, 0, 1)
  1142.                 UpdateSlider()
  1143.             end
  1144.  
  1145.             function element_library:SetValue(Value: number)
  1146.                 percentage = math.clamp((Value - from)/(to - from), 0, 1)
  1147.                 UpdateSlider()
  1148.             end
  1149.  
  1150.             function element_library:SetFrom(From: number)
  1151.                 from = From
  1152.                 percentage = math.clamp((from + ((to - from) * percentage) - from)/(to - from), 0, 1)
  1153.                 UpdateSlider()
  1154.             end
  1155.  
  1156.             function element_library:SetTo(To: number)
  1157.                 to = To
  1158.                 percentage = math.clamp((from + ((to - from) * percentage) - from)/(to - from), 0, 1)
  1159.                 UpdateSlider()
  1160.             end
  1161.  
  1162.             function element_library:GetPercentage()
  1163.                 return percentage
  1164.             end
  1165.  
  1166.             function element_library:GetValue()
  1167.                 return from + ((to - from) * percentage)
  1168.             end
  1169.  
  1170.             function element_library:GetFrom()
  1171.                 return from
  1172.             end
  1173.  
  1174.             function element_library:GetTo()
  1175.                 return to
  1176.             end
  1177.  
  1178.             function element_library:Destroy()
  1179.                 Slider:Destroy()
  1180.             end
  1181.  
  1182.             -- // Return the element's library
  1183.             return element_library
  1184.         end
  1185.  
  1186.         -- // Dropdown
  1187.         function library:CreateDropdown(Text: string, Options, Callback)
  1188.             -- // Create the element's library
  1189.             local element_library = {}
  1190.  
  1191.             -- // Create the dropdown
  1192.             local Dropdown = Instance.new("Frame")
  1193.             Dropdown.Name = "Dropdown"
  1194.             Dropdown.Parent = Frame
  1195.             Dropdown.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1196.             Dropdown.BackgroundTransparency = 1.000
  1197.             Dropdown.Size = UDim2.new(0, 496, 0, 42)
  1198.             Dropdown.ZIndex = 2 -- // Make sure it's on top of the other elements
  1199.  
  1200.             local Dropdown_1 = Instance.new("TextButton")
  1201.             Dropdown_1.Parent = Dropdown
  1202.             Dropdown_1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1203.             Dropdown_1.BackgroundTransparency = 1.000
  1204.             Dropdown_1.BorderSizePixel = 0
  1205.             Dropdown_1.ClipsDescendants = true
  1206.             Dropdown_1.Size = UDim2.new(1, 0, 1, 0)
  1207.             Dropdown_1.Font = Enum.Font.SourceSans
  1208.             Dropdown_1.Text = ""
  1209.             Dropdown_1.TextColor3 = Color3.fromRGB(0, 0, 0)
  1210.             Dropdown_1.TextSize = 14.000
  1211.            
  1212.             local Background = Instance.new("Frame")
  1213.             Background.Name = "Background"
  1214.             Background.Parent = Dropdown_1
  1215.             Background.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1216.             Background.BackgroundTransparency = 0.800
  1217.             Background.BorderSizePixel = 0
  1218.             Background.Size = UDim2.new(1, 0, 1, 0)
  1219.  
  1220.             local Container = Instance.new("Frame")
  1221.             Container.Name = "Container"
  1222.             Container.Parent = Background
  1223.             Container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1224.             Container.BackgroundTransparency = 0.800
  1225.             Container.BorderSizePixel = 0
  1226.             Container.Size = UDim2.new(1, 0, 1, 0)
  1227.  
  1228.             local Label = Instance.new("TextLabel")
  1229.             Label.Parent = Dropdown_1
  1230.             Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1231.             Label.BackgroundTransparency = 1.000
  1232.             Label.BorderSizePixel = 0
  1233.             Label.Size = UDim2.new(1, 0, 1, 0)
  1234.             Label.Font = Enum.Font.GothamMedium
  1235.             Label.Text = Text
  1236.             Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  1237.             Label.TextSize = 18.000
  1238.             Label.TextWrapped = true
  1239.  
  1240.             local Extend = Instance.new("TextButton")
  1241.             Extend.Name = "Extend"
  1242.             Extend.Parent = Dropdown_1
  1243.             Extend.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1244.             Extend.BackgroundTransparency = 1.000
  1245.             Extend.BorderSizePixel = 0
  1246.             Extend.Position = UDim2.new(0.915322602, 0, 0, 0)
  1247.             Extend.Size = UDim2.new(0, 42, 0, 42)
  1248.             Extend.Font = Enum.Font.Code
  1249.             Extend.Text = ">"
  1250.             Extend.TextColor3 = Color3.fromRGB(255, 255, 255)
  1251.             Extend.TextSize = 20.000
  1252.  
  1253.             local Menu = Instance.new("ScrollingFrame")
  1254.             Menu.Name = "Menu"
  1255.             Menu.Parent = Dropdown
  1256.             Menu.Active = true
  1257.             Menu.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1258.             Menu.BackgroundTransparency = 0.400
  1259.             Menu.BorderSizePixel = 0
  1260.             Menu.Position = UDim2.new(0, 0, 1, 0)
  1261.             Menu.Size = UDim2.new(0, 496, 0, 36)
  1262.             Menu.ZIndex = 10
  1263.             Menu.Selectable = true
  1264.             Menu.SelectionOrder = 0
  1265.             Menu.CanvasSize = UDim2.new(0, 0, 0, 0)
  1266.             Menu.CanvasPosition = Vector2.new(0, 0)
  1267.             Menu.ScrollBarThickness = 0
  1268.  
  1269.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  1270.  
  1271.             -- // Create the menu's UIListLayout
  1272.             local UIListLayout = Instance.new("UIListLayout")
  1273.             UIListLayout.Parent = Menu
  1274.             UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  1275.             UIListLayout.Padding = UDim.new(0, 0)
  1276.  
  1277.             -- // Create the menu's UIPadding
  1278.             local UIPadding = Instance.new("UIPadding")
  1279.             UIPadding.Parent = Menu
  1280.             UIPadding.PaddingLeft = UDim.new(0, 5)
  1281.             UIPadding.PaddingRight = UDim.new(0, 5)
  1282.             UIPadding.PaddingTop = UDim.new(0, 0)
  1283.             UIPadding.PaddingBottom = UDim.new(0, 0)
  1284.  
  1285.             local CurrentOption = Options[1]
  1286.  
  1287.             -- // Create the options
  1288.             local function create_option(option: string)
  1289.                 -- // Expand the menu's canvas size
  1290.                 Menu.CanvasSize = Menu.CanvasSize + UDim2.new(0, 0, 0, 36)
  1291.                 Menu.Size = Menu.Size + UDim2.new(0, 0, 0, 36)
  1292.  
  1293.                 -- // Create the option
  1294.                 local Option = Instance.new("TextButton")
  1295.                 Option.Name = "Option"
  1296.                 Option.Parent = Menu
  1297.                 Option.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1298.                 Option.BackgroundTransparency = 1.000
  1299.                 Option.ClipsDescendants = true
  1300.                 Option.Size = UDim2.new(0, 496, 0, 36)
  1301.                 Option.Font = Enum.Font.Gotham
  1302.                 Option.Text = ""
  1303.                 Option.TextColor3 = Color3.fromRGB(186, 186, 186)
  1304.                 Option.TextSize = 14.000
  1305.  
  1306.                 local Background = Instance.new("Frame")
  1307.                 Background.Name = "Background"
  1308.                 Background.Parent = Option
  1309.                 Background.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1310.                 Background.BackgroundTransparency = 0.800
  1311.                 Background.BorderSizePixel = 0
  1312.                 Background.Size = UDim2.new(1, 0, 1, 0)
  1313.  
  1314.                 local Container = Instance.new("Frame")
  1315.                 Container.Name = "Container"
  1316.                 Container.Parent = Background
  1317.                 Container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1318.                 Container.BackgroundTransparency = 0.800
  1319.                 Container.BorderSizePixel = 0
  1320.                 Container.Size = UDim2.new(1, 0, 1, 0)
  1321.                
  1322.                 local Label = Instance.new("TextLabel")
  1323.                 Label.Parent = Option
  1324.                 Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1325.                 Label.BackgroundTransparency = 1.000
  1326.                 Label.BorderSizePixel = 0
  1327.                 Label.Size = UDim2.new(1, 0, 1, 0)
  1328.                 Label.Font = Enum.Font.Gotham
  1329.                 Label.Text = option
  1330.                 Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  1331.                 Label.TextSize = 14.000
  1332.                 Label.TextWrapped = true
  1333.  
  1334.                 -- // Run the script
  1335.                 local active = false
  1336.                 local hovering = false
  1337.                
  1338.                 local circleColour = Color3.fromRGB(53, 53, 53)
  1339.                
  1340.                 local function CreateCircle()
  1341.                     local circle = Instance.new("Frame")
  1342.                     local cornerRadius = Instance.new("UICorner")
  1343.                
  1344.                     circle.AnchorPoint = Vector2.new(0.5, 0.5)
  1345.                     circle.BackgroundColor3 = circleColour
  1346.                     circle.Size = UDim2.new(0, 0, 0, 0)
  1347.                
  1348.                     cornerRadius.CornerRadius = UDim.new(0.5, 0)
  1349.                     cornerRadius.Parent = circle
  1350.                
  1351.                     return circle
  1352.                 end
  1353.                
  1354.                 local function CalculateDistance(pointA, pointB)
  1355.                     return math.sqrt(((pointB.X - pointA.X) ^ 2) + ((pointB.Y - pointA.Y) ^ 2))
  1356.                 end
  1357.                
  1358.                 local function OnMouseButton1Down()
  1359.                     active = true
  1360.                     CurrentOption = option
  1361.                     if Callback ~= nil then
  1362.                         Callback(option)
  1363.                     end
  1364.  
  1365.                     for i, v in pairs(Menu:GetChildren()) do
  1366.                         v.Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  1367.                     end
  1368.                     Label.TextColor3 = Color3.fromRGB(16, 214, 16)
  1369.                
  1370.                     local buttonAbsoluteSize = Option.AbsoluteSize
  1371.                     local buttonAbsolutePosition = Option.AbsolutePosition
  1372.                
  1373.                     local mouseAbsolutePosition = Vector2.new(Mouse.X, Mouse.Y)
  1374.                     local mouseRelativePosition = (mouseAbsolutePosition - buttonAbsolutePosition)
  1375.                    
  1376.                     local circle = CreateCircle()
  1377.                     circle.BackgroundTransparency = 0.84
  1378.                     circle.Position = UDim2.new(0, mouseRelativePosition.X, 0, mouseRelativePosition.Y)
  1379.                     circle.Parent = Container
  1380.                
  1381.                     local topLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, 0))
  1382.                     local topRight = CalculateDistance(mouseRelativePosition, Vector2.new(buttonAbsoluteSize.X, 0))
  1383.                     local bottomRight = CalculateDistance(mouseRelativePosition, buttonAbsoluteSize)
  1384.                     local bottomLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, buttonAbsoluteSize.Y))
  1385.                     local size = math.max(topLeft, topRight, bottomRight, bottomLeft) * 2
  1386.                
  1387.                     local tweenTime = 0.5
  1388.                     local startedTimestamp
  1389.                     local completed = false
  1390.                
  1391.                     local expand = TweenService:Create(circle, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1392.                         Size = UDim2.new(0, size, 0, size)
  1393.                     })
  1394.                
  1395.                     local connection
  1396.                     connection = RunService.RenderStepped:Connect(function()
  1397.                         if not active then
  1398.                             connection:Disconnect()
  1399.                
  1400.                             local defaultTime = tweenTime/3
  1401.                             local timeRemaining = tweenTime - (os.time() - startedTimestamp)
  1402.                             local newTweenTime = not completed and timeRemaining > defaultTime and timeRemaining or defaultTime
  1403.                
  1404.                             local fadeOut = TweenService:Create(circle, TweenInfo.new(newTweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1405.                                 BackgroundTransparency = 1
  1406.                             })
  1407.                
  1408.                             fadeOut:Play()
  1409.                             fadeOut.Completed:Wait()
  1410.                             circle:Destroy()
  1411.                         end
  1412.                     end)
  1413.                
  1414.                     expand:Play()
  1415.                     startedTimestamp = os.time()
  1416.                     expand.Completed:Wait()
  1417.                
  1418.                     completed = true
  1419.                 end
  1420.                
  1421.                 local function OnMouseButton1Up()
  1422.                     active = false
  1423.                 end
  1424.                
  1425.                 local function OnMouseEnter()
  1426.                     hovering = true
  1427.                
  1428.                     local tweenTime = 0.125
  1429.                     local tweenInfo =
  1430.                         TweenInfo.new(tweenTime,
  1431.                             Enum.EasingStyle.Linear,
  1432.                             Enum.EasingDirection.Out)
  1433.                
  1434.                     local backgroundFadeIn = TweenService:Create(Container, tweenInfo, {
  1435.                         BackgroundTransparency = 0.95
  1436.                     })
  1437.                     backgroundFadeIn:Play()
  1438.                     backgroundFadeIn.Completed:Wait()
  1439.                
  1440.                     local backgroundFadeOut = TweenService:Create(Container, tweenInfo, {
  1441.                         BackgroundTransparency = 1
  1442.                     })
  1443.                     repeat wait() until not hovering
  1444.                     backgroundFadeOut:Play()
  1445.                 end
  1446.                
  1447.                 local function OnMouseLeave()
  1448.                     hovering = false
  1449.                     active = false
  1450.                 end
  1451.                
  1452.                 Option.MouseButton1Down:Connect(OnMouseButton1Down)
  1453.                 Option.MouseButton1Up:Connect(OnMouseButton1Up)
  1454.                
  1455.                 Option.MouseEnter:Connect(OnMouseEnter)
  1456.                 Option.MouseLeave:Connect(OnMouseLeave)
  1457.             end
  1458.  
  1459.             for i, option in ipairs(Options) do
  1460.                 create_option(option)
  1461.             end
  1462.  
  1463.             -- // Run the script
  1464.             local active = false
  1465.             local hovering = false
  1466.             local toggled = false
  1467.            
  1468.             local circleColour = Color3.fromRGB(53, 53, 53)
  1469.             local originalDropdownSize = Menu.Size
  1470.             Menu.Size = UDim2.new(1, 0, 0, 0)
  1471.             Menu.Visible = false
  1472.            
  1473.             local function UpdateDropdown()
  1474.                 local extendTween
  1475.                 local dropdownTween
  1476.                
  1477.                 local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
  1478.                
  1479.                 if toggled then
  1480.                     extendTween = TweenService:Create(Extend, tweenInfo, {
  1481.                         Rotation = 90
  1482.                     })
  1483.                     dropdownTween = TweenService:Create(Menu, tweenInfo, {
  1484.                         Size = originalDropdownSize
  1485.                     })
  1486.                 else
  1487.                     extendTween = TweenService:Create(Extend, tweenInfo, {
  1488.                         Rotation = 0
  1489.                     })
  1490.                     dropdownTween = TweenService:Create(Menu, tweenInfo, {
  1491.                         Size = UDim2.new(1, 0, 0, 0)
  1492.                     })
  1493.                 end
  1494.                
  1495.                 extendTween:Play()
  1496.                 dropdownTween:Play()
  1497.             end
  1498.            
  1499.             local function CreateCircle()
  1500.                 local circle = Instance.new("Frame")
  1501.                 local cornerRadius = Instance.new("UICorner")
  1502.            
  1503.                 circle.AnchorPoint = Vector2.new(0.5, 0.5)
  1504.                 circle.BackgroundColor3 = circleColour
  1505.                 circle.Size = UDim2.new(0, 0, 0, 0)
  1506.            
  1507.                 cornerRadius.CornerRadius = UDim.new(0.5, 0)
  1508.                 cornerRadius.Parent = circle
  1509.            
  1510.                 return circle
  1511.             end
  1512.            
  1513.             local function CalculateDistance(pointA, pointB)
  1514.                 return math.sqrt(((pointB.X - pointA.X) ^ 2) + ((pointB.Y - pointA.Y) ^ 2))
  1515.             end
  1516.            
  1517.             local function OnMouseButton1Down()
  1518.                 active = true
  1519.                
  1520.                 if toggled then
  1521.                     toggled = false
  1522.                 else
  1523.                     toggled = true
  1524.                 end
  1525.                
  1526.                 UpdateDropdown()
  1527.            
  1528.                 local buttonAbsoluteSize = Dropdown_1.AbsoluteSize
  1529.                 local buttonAbsolutePosition = Dropdown_1.AbsolutePosition
  1530.            
  1531.                 local mouseAbsolutePosition = Vector2.new(Mouse.X, Mouse.Y)
  1532.                 local mouseRelativePosition = (mouseAbsolutePosition - buttonAbsolutePosition)
  1533.            
  1534.                 local circle = CreateCircle()
  1535.                 circle.BackgroundTransparency = 0.84
  1536.                 circle.Position = UDim2.new(0, mouseRelativePosition.X, 0, mouseRelativePosition.Y)
  1537.                 circle.Parent = Container
  1538.            
  1539.                 local topLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, 0))
  1540.                 local topRight = CalculateDistance(mouseRelativePosition, Vector2.new(buttonAbsoluteSize.X, 0))
  1541.                 local bottomRight = CalculateDistance(mouseRelativePosition, buttonAbsoluteSize)
  1542.                 local bottomLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, buttonAbsoluteSize.Y))
  1543.                 local size = math.max(topLeft, topRight, bottomRight, bottomLeft) * 2
  1544.            
  1545.                 local tweenTime = 0.5
  1546.                 local startedTimestamp
  1547.                 local completed = false
  1548.            
  1549.                 local expand = TweenService:Create(circle, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1550.                     Size = UDim2.new(0, size, 0, size)
  1551.                 })
  1552.            
  1553.                 local connection
  1554.                 connection = RunService.RenderStepped:Connect(function()
  1555.                     if not active then
  1556.                         connection:Disconnect()
  1557.            
  1558.                         local defaultTime = tweenTime/3
  1559.                         local timeRemaining = tweenTime - (os.time() - startedTimestamp)
  1560.                         local newTweenTime = not completed and timeRemaining > defaultTime and timeRemaining or defaultTime
  1561.            
  1562.                         local fadeOut = TweenService:Create(circle, TweenInfo.new(newTweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1563.                             BackgroundTransparency = 1
  1564.                         })
  1565.            
  1566.                         fadeOut:Play()
  1567.                         fadeOut.Completed:Wait()
  1568.                         circle:Destroy()
  1569.                     end
  1570.                 end)
  1571.            
  1572.                 expand:Play()
  1573.                 startedTimestamp = os.time()
  1574.                 expand.Completed:Wait()
  1575.            
  1576.                 completed = true
  1577.             end
  1578.            
  1579.             local function OnMouseButton1Up()
  1580.                 active = false
  1581.             end
  1582.            
  1583.             local function OnMouseEnter()
  1584.                 hovering = true
  1585.            
  1586.                 local tweenTime = 0.125
  1587.                 local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  1588.            
  1589.                 local backgroundFadeIn = TweenService:Create(Container, tweenInfo, {
  1590.                     BackgroundTransparency = 0.95
  1591.                 })
  1592.                 backgroundFadeIn:Play()
  1593.                 backgroundFadeIn.Completed:Wait()
  1594.            
  1595.                 local backgroundFadeOut = TweenService:Create(Container, tweenInfo, {
  1596.                     BackgroundTransparency = 1
  1597.                 })
  1598.                 repeat wait() until not hovering
  1599.                 backgroundFadeOut:Play()
  1600.             end
  1601.            
  1602.             local function OnMouseLeave()
  1603.                 hovering = false
  1604.                 active = false
  1605.             end
  1606.            
  1607.             UpdateDropdown()
  1608.            
  1609.             Dropdown_1.MouseButton1Down:Connect(OnMouseButton1Down)
  1610.             Dropdown_1.MouseButton1Up:Connect(OnMouseButton1Up)
  1611.             Extend.MouseButton1Down:Connect(OnMouseButton1Down)
  1612.             Extend.MouseButton1Up:Connect(OnMouseButton1Up)
  1613.            
  1614.             Dropdown_1.MouseEnter:Connect(OnMouseEnter)
  1615.             Dropdown_1.MouseLeave:Connect(OnMouseLeave)
  1616.             Extend.MouseEnter:Connect(OnMouseEnter)
  1617.             Extend.MouseLeave:Connect(OnMouseLeave)
  1618.  
  1619.             -- // Functions
  1620.             function element_library:AddOption(option)
  1621.                 create_option(option)
  1622.             end
  1623.  
  1624.             function element_library:RemoveOption(option)
  1625.                 for i, v in pairs(Menu:GetChildren()) do
  1626.                     if v.Name == option then
  1627.                         v:Destroy()
  1628.                     end
  1629.                 end
  1630.             end
  1631.  
  1632.             function element_library:ClearOptions()
  1633.                 for i, option in ipairs(Menu:GetChildren()) do
  1634.                     if option:IsA("TextButton") then
  1635.                         option:Destroy()
  1636.                     end
  1637.                 end
  1638.             end
  1639.  
  1640.             function element_library:AddOptions(Options)
  1641.                 for i, option in ipairs(Options) do
  1642.                     create_option(option)
  1643.                 end
  1644.             end
  1645.  
  1646.             function element_library:GetOptions()
  1647.                 return Options
  1648.             end
  1649.  
  1650.             function element_library:GetOption()
  1651.                 return CurrentOption
  1652.             end
  1653.  
  1654.             function element_library:SetOption(option)
  1655.                 for i, v in pairs(Menu:GetChildren()) do
  1656.                     if v.Name == option then
  1657.                         CurrentOption = option
  1658.                         v.Label.TextColor3 = Color3.fromRGB(16, 214, 16)
  1659.                     else
  1660.                         v.Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  1661.                     end
  1662.                 end
  1663.             end
  1664.  
  1665.             function element_library:Destroy()
  1666.                 Dropdown:Destroy()
  1667.             end
  1668.  
  1669.             -- // Return the element's library
  1670.             return element_library
  1671.         end
  1672.  
  1673.         -- // Colour Picker
  1674.         function library:CreateColourPicker(Text: string, Colour: Color3, Callback)
  1675.             -- // Create the element's library
  1676.             local element_library = {}
  1677.  
  1678.             -- // Create the colour picker
  1679.             local ColourPicker = Instance.new("Frame")
  1680.             ColourPicker.Name = "ColourPicker"
  1681.             ColourPicker.Parent = Frame
  1682.             ColourPicker.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1683.             ColourPicker.BackgroundTransparency = 1.000
  1684.             ColourPicker.Size = UDim2.new(0, 496, 0, 42)
  1685.             ColourPicker.ZIndex = 2 -- // Make sure it's on top of the other elements
  1686.  
  1687.             local ColourPicker_1 = Instance.new("TextButton")
  1688.             ColourPicker_1.Parent = ColourPicker
  1689.             ColourPicker_1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1690.             ColourPicker_1.BackgroundTransparency = 1.000
  1691.             ColourPicker_1.BorderSizePixel = 0
  1692.             ColourPicker_1.ClipsDescendants = true
  1693.             ColourPicker_1.Size = UDim2.new(1, 0, 1, 0)
  1694.             ColourPicker_1.Font = Enum.Font.SourceSans
  1695.             ColourPicker_1.Text = ""
  1696.             ColourPicker_1.TextColor3 = Color3.fromRGB(0, 0, 0)
  1697.             ColourPicker_1.TextSize = 14.000
  1698.  
  1699.             local Background = Instance.new("Frame")
  1700.             Background.Name = "Background"
  1701.             Background.Parent = ColourPicker_1
  1702.             Background.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1703.             Background.BackgroundTransparency = 0.800
  1704.             Background.BorderSizePixel = 0
  1705.             Background.Size = UDim2.new(1, 0, 1, 0)
  1706.  
  1707.             local Container = Instance.new("Frame")
  1708.             Container.Name = "Container"
  1709.             Container.Parent = Background
  1710.             Container.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1711.             Container.BackgroundTransparency = 0.800
  1712.             Container.BorderSizePixel = 0
  1713.             Container.Size = UDim2.new(1, 0, 1, 0)
  1714.  
  1715.             local Display = Instance.new("TextButton")
  1716.             Display.Name = "Display"
  1717.             Display.Parent = Background
  1718.             Display.BackgroundColor3 = Colour
  1719.             Display.BackgroundTransparency = 0.400
  1720.             Display.Position = UDim2.new(0.0140000004, 0, 0.238000005, 0)
  1721.             Display.Size = UDim2.new(0.125, 0, 0.5, 0)
  1722.             Display.Font = Enum.Font.SourceSans
  1723.             Display.Text = ""
  1724.             Display.TextColor3 = Color3.fromRGB(0, 0, 0)
  1725.             Display.TextSize = 14.000
  1726.  
  1727.             local Label = Instance.new("TextLabel")
  1728.             Label.Parent = ColourPicker_1
  1729.             Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1730.             Label.BackgroundTransparency = 1.000
  1731.             Label.BorderSizePixel = 0
  1732.             Label.Size = UDim2.new(1, 0, 1, 0)
  1733.             Label.Font = Enum.Font.GothamMedium
  1734.             Label.Text = Text
  1735.             Label.TextColor3 = Color3.fromRGB(236, 236, 236)
  1736.             Label.TextSize = 18.000
  1737.             Label.TextWrapped = true
  1738.  
  1739.             local Menu = Instance.new("Frame")
  1740.             Menu.Name = "Menu"
  1741.             Menu.Parent = ColourPicker
  1742.             Menu.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  1743.             Menu.BackgroundTransparency = 0.650
  1744.             Menu.BorderSizePixel = 0
  1745.             Menu.ClipsDescendants = true
  1746.             Menu.Position = UDim2.new(0, 0, 1.00000072, 0)
  1747.             Menu.Selectable = true
  1748.             Menu.Size = UDim2.new(0, 496, 0, 135)
  1749.             Menu.ZIndex = 9e9 -- // Make sure it's on top of the other elements
  1750.  
  1751.             local A = Instance.new("Frame")
  1752.             A.Name = "A"
  1753.             A.Parent = Menu
  1754.             A.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1755.             A.BorderSizePixel = 0
  1756.             A.ClipsDescendants = true
  1757.             A.Position = UDim2.new(0.900983751, 0, 0.0590001978, 0)
  1758.             A.Size = UDim2.new(0, 38, 0, 114)
  1759.  
  1760.             local UIGradient = Instance.new("UIGradient")
  1761.             UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(0, 0, 0))}
  1762.             UIGradient.Rotation = 90
  1763.             UIGradient.Parent = A
  1764.  
  1765.             local Marker = Instance.new("Frame")
  1766.             Marker.Name = "Marker"
  1767.             Marker.Parent = A
  1768.             Marker.AnchorPoint = Vector2.new(0.5, 0.5)
  1769.             Marker.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1770.             Marker.BorderSizePixel = 0
  1771.             Marker.Position = UDim2.new(0.5, 0, 0, 0)
  1772.             Marker.Size = UDim2.new(0, 6, 0, 6)
  1773.  
  1774.             local UICorner = Instance.new("UICorner")
  1775.             UICorner.CornerRadius = UDim.new(1, 0)
  1776.             UICorner.Parent = Marker
  1777.  
  1778.             local RGB = Instance.new("Frame")
  1779.             RGB.Name = "RGB"
  1780.             RGB.Parent = Menu
  1781.             RGB.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1782.             RGB.BorderSizePixel = 0
  1783.             RGB.Position = UDim2.new(0.0199999996, 0, 0.0590000004, 0)
  1784.             RGB.Selectable = true
  1785.             RGB.Size = UDim2.new(0, 430, 0, 114)
  1786.  
  1787.             local Gradient = Instance.new("Frame")
  1788.             Gradient.Name = "Gradient"
  1789.             Gradient.Parent = RGB
  1790.             Gradient.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1791.             Gradient.BorderSizePixel = 0
  1792.             Gradient.ClipsDescendants = true
  1793.             Gradient.Size = UDim2.new(1, 0, 1, 0)
  1794.  
  1795.             local UIGradient_2 = Instance.new("UIGradient")
  1796.             UIGradient_2.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 0, 0)), ColorSequenceKeypoint.new(0.50, Color3.fromRGB(0, 255, 0)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(0, 0, 255))}
  1797.             UIGradient_2.Parent = Gradient
  1798.  
  1799.             local Marker_2 = Instance.new("Frame")
  1800.             Marker_2.Name = "Marker"
  1801.             Marker_2.Parent = Gradient
  1802.             Marker_2.AnchorPoint = Vector2.new(0.5, 0.5)
  1803.             Marker_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1804.             Marker_2.BorderSizePixel = 0
  1805.             Marker_2.Size = UDim2.new(0, 6, 0, 6)
  1806.  
  1807.             local UICorner_2 = Instance.new("UICorner")
  1808.             UICorner_2.CornerRadius = UDim.new(1, 0)
  1809.             UICorner_2.Parent = Marker_2
  1810.  
  1811.             local Fade = Instance.new("ImageLabel")
  1812.             Fade.Name = "Fade"
  1813.             Fade.Parent = RGB
  1814.             Fade.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1815.             Fade.BackgroundTransparency = 1.000
  1816.             Fade.BorderSizePixel = 0
  1817.             Fade.Size = UDim2.new(1, 0, 1, 0)
  1818.             Fade.Image = "http://www.roblox.com/asset/?id=10890905921"
  1819.             Fade.ImageTransparency = 0.250
  1820.  
  1821.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  1822.  
  1823.             -- // Run the script
  1824.             local active = false
  1825.             local hovering = false
  1826.             local dragging = false
  1827.             local toggled = false
  1828.  
  1829.             local circle_colour = Color3.fromRGB(53, 53, 53)
  1830.             local colour = Colour
  1831.             local target
  1832.             local target_marker
  1833.  
  1834.             local h, s, v = Colour:ToHSV()
  1835.             local colour_data = {
  1836.                 h, s, v
  1837.             }
  1838.  
  1839.             local originalColourPickerSize = Menu.Size
  1840.             Menu.Size = UDim2.new(1, 0, 0, 0)
  1841.            
  1842.             local function SetColour(h, s, v)
  1843.                 colour_data = {h or colour_data[1], s or colour_data[2], v or colour_data[3]}
  1844.                 colour = Color3.fromHSV(colour_data[1], colour_data[2], colour_data[3])
  1845.             end
  1846.  
  1847.             local function UpdateColourPicker()
  1848.                 local colourPickerTween
  1849.                 local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
  1850.            
  1851.                 if toggled then
  1852.                     colourPickerTween = TweenService:Create(Menu, tweenInfo, {
  1853.                         Size = originalColourPickerSize
  1854.                     })
  1855.                 else
  1856.                     colourPickerTween = TweenService:Create(Menu, tweenInfo, {
  1857.                         Size = UDim2.new(1, 0, 0, 0)
  1858.                     })
  1859.                 end
  1860.            
  1861.                 colourPickerTween:Play()
  1862.             end
  1863.  
  1864.             local function UpdateColour()
  1865.                 local X, Y = InBounds(target, Mouse.X, Mouse.Y)
  1866.                 if InBounds(target, Mouse.X, Mouse.Y) == nil then return end
  1867.  
  1868.                 X = math.clamp(X, 0, 1)
  1869.                 Y = math.clamp(Y, 0, 1)
  1870.                
  1871.                 if X and Y then
  1872.                     if target == A then
  1873.                         SetColour(nil, nil, 1 - Y)
  1874.                         target_marker.Position = UDim2.new(0.5, 0, Y, 0)
  1875.                     elseif target == RGB then
  1876.                         print(X, Y)
  1877.                         SetColour(1 - X, 1 - Y)
  1878.                         target_marker.Position = UDim2.new(X, 0, Y, 0)
  1879.                     end
  1880.                 end
  1881.  
  1882.                 local colourTween = TweenService:Create(Display, TweenInfo.new(0.25, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
  1883.                     BackgroundColor3 = colour
  1884.                 })
  1885.                 colourTween:Play()
  1886.  
  1887.                 if Callback ~= nil then
  1888.                     Callback(colour)
  1889.                 end
  1890.             end
  1891.    
  1892.             local function CreateCircle()
  1893.                 local circle = Instance.new("Frame")
  1894.                 local cornerRadius = Instance.new("UICorner")
  1895.            
  1896.                 circle.AnchorPoint = Vector2.new(0.5, 0.5)
  1897.                 circle.BackgroundColor3 = circle_colour
  1898.                 circle.Size = UDim2.new(0, 0, 0, 0)
  1899.            
  1900.                 cornerRadius.CornerRadius = UDim.new(0.5, 0)
  1901.                 cornerRadius.Parent = circle
  1902.            
  1903.                 return circle
  1904.             end
  1905.    
  1906.             local function CalculateDistance(pointA, pointB)
  1907.                 return math.sqrt(((pointB.X - pointA.X) ^ 2) + ((pointB.Y - pointA.Y) ^ 2))
  1908.             end
  1909.  
  1910.             local function OnMouseButton1Down()
  1911.                 active = true
  1912.            
  1913.                 if toggled then
  1914.                     toggled = false
  1915.                 else
  1916.                     toggled = true
  1917.                 end
  1918.                
  1919.                 UpdateColourPicker()
  1920.                
  1921.                 local buttonAbsoluteSize = ColourPicker_1.AbsoluteSize
  1922.                 local buttonAbsolutePosition = ColourPicker_1.AbsolutePosition
  1923.            
  1924.                 local mouseAbsolutePosition = Vector2.new(Mouse.X, Mouse.Y)
  1925.                 local mouseRelativePosition = (mouseAbsolutePosition - buttonAbsolutePosition)
  1926.            
  1927.                 local circle = CreateCircle()
  1928.                 circle.BackgroundTransparency = 0.84
  1929.                 circle.Position = UDim2.new(0, mouseRelativePosition.X, 0, mouseRelativePosition.Y)
  1930.                 circle.Parent = Container
  1931.            
  1932.                 local topLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, 0))
  1933.                 local topRight = CalculateDistance(mouseRelativePosition, Vector2.new(buttonAbsoluteSize.X, 0))
  1934.                 local bottomRight = CalculateDistance(mouseRelativePosition, buttonAbsoluteSize)
  1935.                 local bottomLeft = CalculateDistance(mouseRelativePosition, Vector2.new(0, buttonAbsoluteSize.Y))
  1936.                 local size = math.max(topLeft, topRight, bottomRight, bottomLeft) * 2
  1937.            
  1938.                 local tweenTime = 0.5
  1939.                 local startedTimestamp
  1940.                 local completed = false
  1941.            
  1942.                 local expand = TweenService:Create(circle, TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1943.                     Size = UDim2.new(0, size, 0, size)
  1944.                 })
  1945.            
  1946.                 local connection
  1947.                 connection = RunService.RenderStepped:Connect(function()
  1948.                     if not active then
  1949.                         connection:Disconnect()
  1950.            
  1951.                         local defaultTime = tweenTime/3
  1952.                         local timeRemaining = tweenTime - (os.time() - startedTimestamp)
  1953.                         local newTweenTime = not completed and timeRemaining > defaultTime and timeRemaining or defaultTime
  1954.            
  1955.                         local fadeOut = TweenService:Create(circle, TweenInfo.new(newTweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
  1956.                             BackgroundTransparency = 1
  1957.                         })
  1958.            
  1959.                         fadeOut:Play()
  1960.                         fadeOut.Completed:Wait()
  1961.                         circle:Destroy()
  1962.                     end
  1963.                 end)
  1964.            
  1965.                 expand:Play()
  1966.                 startedTimestamp = os.time()
  1967.                 expand.Completed:Wait()
  1968.            
  1969.                 completed = true
  1970.             end
  1971.            
  1972.             local function OnMouseButton1Up()
  1973.                 active = false
  1974.             end
  1975.    
  1976.             local function OnMouseBegin(input)
  1977.                 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  1978.                     local X = Mouse.X
  1979.                     local Y = Mouse.Y
  1980.            
  1981.                     if not IsInBounds(Menu, X, Y) then
  1982.                         dragging = false
  1983.                         return
  1984.                     end
  1985.            
  1986.                     if not toggled then
  1987.                         dragging = false
  1988.                         return
  1989.                     end
  1990.                    
  1991.                     if IsInBounds(A, X, Y) then
  1992.                         dragging = true
  1993.                         target = A
  1994.                         target_marker = Marker
  1995.                        
  1996.                         UpdateColour()
  1997.                     elseif IsInBounds(RGB, X, Y) then
  1998.                         dragging = true
  1999.                         target = RGB
  2000.                         target_marker = Marker_2
  2001.            
  2002.                         UpdateColour()
  2003.                     end
  2004.                 end
  2005.             end
  2006.  
  2007.             local function OnMouseEnter()
  2008.                 hovering = true
  2009.            
  2010.                 local tweenTime = 0.125
  2011.                 local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  2012.            
  2013.                 local backgroundFadeIn = TweenService:Create(Container, tweenInfo, {
  2014.                     BackgroundTransparency = 0.95
  2015.                 })
  2016.                 backgroundFadeIn:Play()
  2017.                 backgroundFadeIn.Completed:Wait()
  2018.            
  2019.                 local backgroundFadeOut = TweenService:Create(Container, tweenInfo, {
  2020.                     BackgroundTransparency = 1
  2021.                 })
  2022.                 repeat wait() until not hovering
  2023.                 backgroundFadeOut:Play()
  2024.             end
  2025.            
  2026.             local function OnMouseMove(input)
  2027.                 local X = Mouse.X
  2028.                 local Y = Mouse.Y
  2029.                
  2030.                 if dragging then
  2031.                     UpdateColour()
  2032.                 end
  2033.             end
  2034.            
  2035.             local function OnMouseEnded(input)
  2036.                 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  2037.                     dragging = false
  2038.                     UpdateColourPicker()
  2039.                     UpdateColour()
  2040.                 end
  2041.             end
  2042.            
  2043.             local function OnMouseLeave(input)
  2044.                 active = false
  2045.             end
  2046.            
  2047.             UpdateColourPicker()
  2048.            
  2049.             ColourPicker_1.MouseButton1Down:Connect(OnMouseButton1Down)
  2050.             Display.MouseButton1Down:Connect(OnMouseButton1Down)
  2051.             ColourPicker_1.MouseButton1Up:Connect(OnMouseButton1Up)
  2052.             Display.MouseButton1Up:Connect(OnMouseButton1Up)
  2053.            
  2054.             ColourPicker_1.MouseEnter:Connect(OnMouseEnter)
  2055.             Display.MouseEnter:Connect(OnMouseEnter)
  2056.             ColourPicker_1.MouseLeave:Connect(OnMouseLeave)
  2057.             Display.MouseLeave:Connect(OnMouseLeave)
  2058.            
  2059.             UserInputService.InputBegan:Connect(OnMouseBegin)
  2060.             UserInputService.InputChanged:Connect(OnMouseMove)
  2061.             UserInputService.InputEnded:Connect(OnMouseEnded)
  2062.  
  2063.             -- // Functions
  2064.             function element_library:SetText(Text: string)
  2065.                 Label.Text = Text
  2066.             end
  2067.  
  2068.             function element_library:GetText()
  2069.                 return Label.Text
  2070.             end
  2071.  
  2072.             function element_library:SetColour(Colour: Color3)
  2073.                 colour = Colour
  2074.                
  2075.                 local h, s, v = Colour:ToHSV()
  2076.                 local colour_data = {
  2077.                     h, s, v
  2078.                 }
  2079.  
  2080.                 Marker.Position = UDim2.new(colour_data.S, 0, 1 - colour_data.V, 0)
  2081.                 Marker_2.Position = UDim2.new(colour_data.H, 0, 0, 0)
  2082.                 UpdateColourPicker()
  2083.             end
  2084.  
  2085.             function element_library:GetColour()
  2086.                 return colour
  2087.             end
  2088.  
  2089.             function element_library:Destroy()
  2090.                 ColourPicker:Destroy()
  2091.             end
  2092.  
  2093.             -- // Return the element's library
  2094.             return element_library
  2095.         end
  2096.  
  2097.         -- // TextBox
  2098.         function library:CreateTextBox(Text: string, Callback)
  2099.             -- // Create the textbox
  2100.             local TextBox = Instance.new("Frame")
  2101.             TextBox.Name = "Textbox"
  2102.             TextBox.Parent = Frame
  2103.             TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  2104.             TextBox.BackgroundTransparency = 1.000
  2105.             TextBox.Size = UDim2.new(0, 496, 0, 42)
  2106.  
  2107.             local TextBox_1 = Instance.new("TextBox")
  2108.             TextBox_1.Parent = TextBox
  2109.             TextBox_1.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  2110.             TextBox_1.BackgroundTransparency = 0.800
  2111.             TextBox_1.BorderSizePixel = 0
  2112.             TextBox_1.Size = UDim2.new(1, 0, 1, 0)
  2113.             TextBox_1.Font = Enum.Font.Gotham
  2114.             TextBox_1.PlaceholderColor3 = Color3.fromRGB(178, 178, 178)
  2115.             TextBox_1.PlaceholderText = Text
  2116.             TextBox_1.Text = ""
  2117.             TextBox_1.TextColor3 = Color3.fromRGB(195, 195, 195)
  2118.             TextBox_1.TextSize = 14.000
  2119.  
  2120.             -- // Register the callback
  2121.             TextBox_1.FocusLost:Connect(function(EnterPressed)
  2122.                 if Callback ~= nil then
  2123.                     Callback(TextBox_1.Text)
  2124.                 end
  2125.             end)
  2126.         end
  2127.  
  2128.         -- // Bind the tab button to show
  2129.         -- // the tab panel when clicked
  2130.         Button.MouseButton1Down:Connect(function()
  2131.             -- // Hide all tabs
  2132.             for i, child in ipairs(Menu:GetChildren()) do
  2133.                 child.Visible = false
  2134.             end
  2135.  
  2136.             -- // Show the tab
  2137.             Frame.Visible = true
  2138.         end)
  2139.  
  2140.         -- // NumberBox
  2141.         function library:CreateNumberBox(Text: string, Callback)
  2142.             -- // Create the textbox
  2143.             local NumberBox = Instance.new("Frame")
  2144.             NumberBox.Name = "Textbox"
  2145.             NumberBox.Parent = Frame
  2146.             NumberBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  2147.             NumberBox.BackgroundTransparency = 1.000
  2148.             NumberBox.Size = UDim2.new(0, 496, 0, 42)
  2149.  
  2150.             local NumberBox_1 = Instance.new("TextBox")
  2151.             NumberBox_1.Parent = NumberBox
  2152.             NumberBox_1.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  2153.             NumberBox_1.BackgroundTransparency = 0.800
  2154.             NumberBox_1.BorderSizePixel = 0
  2155.             NumberBox_1.Size = UDim2.new(1, 0, 1, 0)
  2156.             NumberBox_1.Font = Enum.Font.Gotham
  2157.             NumberBox_1.PlaceholderColor3 = Color3.fromRGB(178, 178, 178)
  2158.             NumberBox_1.PlaceholderText = Text
  2159.             NumberBox_1.Text = ""
  2160.             NumberBox_1.TextColor3 = Color3.fromRGB(195, 195, 195)
  2161.             NumberBox_1.TextSize = 14.000
  2162.  
  2163.             Frame.CanvasSize = Frame.CanvasSize + UDim2.new(0, 0, 0, 42)
  2164.  
  2165.             -- // Script
  2166.             local function filter(str: string)
  2167.                 for i = 1, #str do
  2168.                     local c = str:sub(i,i)
  2169.                     if not tonumber(c) then
  2170.                         str = str:gsub(c, "")
  2171.                     end
  2172.                 end
  2173.  
  2174.                 return str
  2175.             end
  2176.  
  2177.             NumberBox_1.InputChanged:Connect(function()
  2178.                 NumberBox_1.Text = filter(NumberBox_1.Text)
  2179.             end)
  2180.  
  2181.             -- // Register the callback
  2182.             NumberBox_1.FocusLost:Connect(function()
  2183.                 NumberBox_1.Text = filter(NumberBox_1.Text)
  2184.                 if Callback ~= nil then
  2185.                     Callback(tonumber(NumberBox_1.Text))
  2186.                 end
  2187.             end)
  2188.         end
  2189.  
  2190.         -- // Bind the tab button to show
  2191.         -- // the tab panel when clicked
  2192.         Button.MouseButton1Down:Connect(function()
  2193.             -- // Hide all tabs
  2194.             for i, child in ipairs(Menu:GetChildren()) do
  2195.                 child.Visible = false
  2196.             end
  2197.  
  2198.             -- // Show the tab
  2199.             Frame.Visible = true
  2200.         end)
  2201.  
  2202.         --// Return the library
  2203.         return library
  2204.     end
  2205.  
  2206.     function library:CreateNotification(Title: string, Description: string, Length: number, Callback)
  2207.         -- // Set the default length to 5 seconds if none is provided
  2208.         Length = Length or 5
  2209.  
  2210.         -- // Use a coroutine to create the notification
  2211.         -- // as to not block the thread
  2212.         coroutine.resume(coroutine.create(function()
  2213.             -- // Create the notification
  2214.             local Notification = Instance.new("Frame")
  2215.             Notification.Name = "Notification"
  2216.             Notification.Parent = Notifications
  2217.             Notification.BackgroundColor3 = Color3.fromRGB(21, 21, 21)
  2218.             Notification.BorderSizePixel = 0
  2219.             Notification.ClipsDescendants = true
  2220.             Notification.Position = UDim2.new(0.861995757, 0, 0.912711024, 0)
  2221.             Notification.Size = UDim2.new(0, 285, 0, 100)
  2222.             Notification.Style = Enum.FrameStyle.RobloxRound
  2223.  
  2224.             local Title_Label = Instance.new("TextLabel")
  2225.             Title_Label.Name = "Title"
  2226.             Title_Label.Parent = Notification
  2227.             Title_Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  2228.             Title_Label.BackgroundTransparency = 1.000
  2229.             Title_Label.Position = UDim2.new(0.028070176, 0, 0.0799999982, 0)
  2230.             Title_Label.Size = UDim2.new(0, 255, 0, 37)
  2231.             Title_Label.Font = Enum.Font.GothamBlack
  2232.             Title_Label.Text = Title
  2233.             Title_Label.TextColor3 = Color3.fromRGB(255, 255, 255)
  2234.             Title_Label.TextScaled = true
  2235.             Title_Label.TextSize = 14.000
  2236.             Title_Label.TextWrapped = true
  2237.             Title_Label.TextXAlignment = Enum.TextXAlignment.Left
  2238.  
  2239.             local Description_Label = Instance.new("TextLabel")
  2240.             Description_Label.Name = "Description"
  2241.             Description_Label.Parent = Notification
  2242.             Description_Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  2243.             Description_Label.BackgroundTransparency = 1.000
  2244.             Description_Label.Position = UDim2.new(0.0545645729, 0, 0.5, 0)
  2245.             Description_Label.Size = UDim2.new(0, 254, 0, 37)
  2246.             Description_Label.Font = Enum.Font.GothamMedium
  2247.             Description_Label.Text = Description
  2248.             Description_Label.TextColor3 = Color3.fromRGB(255, 255, 255)
  2249.             Description_Label.TextSize = 16.000
  2250.             Description_Label.TextWrapped = true
  2251.             Description_Label.TextXAlignment = Enum.TextXAlignment.Left
  2252.  
  2253.             -- // Run the script
  2254.             local originalNotificationSize = Notification.Size
  2255.             Notification.Size = UDim2.new(0, 0, 0, 0)
  2256.  
  2257.             local notificationInTween = TweenService:Create(Notification, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
  2258.                 Size = originalNotificationSize
  2259.             })
  2260.  
  2261.             local notificationOutTween = TweenService:Create(Notification, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
  2262.                 Size = UDim2.new(0, 0, 0, 100)
  2263.             })
  2264.  
  2265.             notificationInTween:Play()
  2266.             wait(Length)
  2267.             notificationOutTween:Play()
  2268.             notificationOutTween.Completed:Wait()
  2269.             Notification:Destroy()      
  2270.  
  2271.             if Callback ~= nil then
  2272.                 Callback()
  2273.             end
  2274.         end))
  2275.     end
  2276.  
  2277.     function library:Close()
  2278.         local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  2279.         local bodyScaleTween = TweenService:Create(UIScale, tweenInfo, {
  2280.             Scale = 0
  2281.         })
  2282.         local notificationsScaleTween = TweenService:Create(UIScale_1, tweenInfo, {
  2283.             Scale = 0
  2284.         })
  2285.  
  2286.         bodyScaleTween:Play()
  2287.         notificationsScaleTween:Play()
  2288.         bodyScaleTween.Completed:Wait()
  2289.  
  2290.         Body.Visible = false
  2291.         Notifications.Visible = false
  2292.         FestivalWare.Enabled = false
  2293.  
  2294.         Body:Destroy()
  2295.         Notifications:Destroy()
  2296.         FestivalWare:Destroy()
  2297.     end
  2298.  
  2299.     function library:Hide()
  2300.         local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  2301.         local bodyScaleTween = TweenService:Create(UIScale, tweenInfo, {
  2302.             Scale = 0
  2303.         })
  2304.         bodyScaleTween:Play()
  2305.         bodyScaleTween.Completed:Wait()
  2306.  
  2307.         Body.Visible = false
  2308.     end
  2309.  
  2310.     function library:Show()
  2311.         Body.Visible = true
  2312.  
  2313.         local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  2314.         local bodyScaleTween = TweenService:Create(UIScale, tweenInfo, {
  2315.             Scale = 1
  2316.         })
  2317.         bodyScaleTween:Play()
  2318.         bodyScaleTween.Completed:Wait()
  2319.     end
  2320.  
  2321.     function library:Toggle()
  2322.         if Body.Visible then
  2323.             library:Hide()
  2324.         else
  2325.             library:Show()
  2326.         end
  2327.     end
  2328.    
  2329.     UserInputService.InputBegan:Connect(function(input)
  2330.         if input.KeyCode == Enum.KeyCode.RightControl then
  2331.             library:Toggle()
  2332.         end
  2333.     end)
  2334.  
  2335.     -- // Make the window draggable
  2336.     draggable(Body, Menu)
  2337.  
  2338.     --// Return the library
  2339.     return library
  2340. end
  2341.  
  2342. return library
Advertisement
Add Comment
Please, Sign In to add comment