Advertisement
KevinnT

Coastified

Oct 10th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 75.59 KB | None | 0 0
  1. -- Feel free to edit, modify or use!
  2.  
  3. local UserInputService = game:GetService("UserInputService")
  4. local TweenService = game:GetService("TweenService")
  5. local RunService = game:GetService("RunService")
  6.  
  7. local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
  8.  
  9. local RainbowModeColorValue = 0
  10. local ColorPickerZIndex = 1
  11.  
  12. local RainbowModeColorValue = 0
  13. local ColorPickerZIndex = 1
  14.  
  15. local WindowPosition = 0
  16.  
  17. local CoastifiedLibrary = Instance.new("ScreenGui")
  18. local Container = Instance.new("Frame")
  19.  
  20. CoastifiedLibrary.Name = "CoastifiedLibrary"
  21. CoastifiedLibrary.Parent = game:GetService("CoreGui")
  22.  
  23. Container.Name = "Container"
  24. Container.Parent = CoastifiedLibrary
  25. Container.BackgroundColor3 = Color3.new(1, 1, 1)
  26. Container.BackgroundTransparency = 1
  27. Container.Size = UDim2.new(0, 100, 0, 100)
  28.  
  29. UserInputService.InputBegan:Connect(function(input)
  30.     if input.KeyCode == Enum.KeyCode.RightControl then
  31.         CoastifiedLibrary.Enabled = not CoastifiedLibrary.Enabled
  32.     end
  33. end)
  34.  
  35. function Dragging(instancename)
  36.     local dragging = nil
  37.     local dragInput = nil
  38.     local dragStart = nil
  39.     local startPos = nil
  40.  
  41.     local function update(input)
  42.         local delta = input.Position - dragStart
  43.         instancename.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  44.     end
  45.  
  46.     instancename.InputBegan:Connect(function(input)
  47.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  48.             dragging = true
  49.             dragStart = input.Position
  50.             startPos = instancename.Position
  51.            
  52.             input.Changed:Connect(function()
  53.                 if input.UserInputState == Enum.UserInputState.End then
  54.                     dragging = false
  55.                 end
  56.             end)
  57.         end
  58.     end)
  59.  
  60.     instancename.InputChanged:Connect(function(input)
  61.         if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  62.             dragInput = input
  63.         end
  64.     end)
  65.  
  66.     UserInputService.InputChanged:Connect(function(input)
  67.         if input == dragInput and dragging then
  68.             update(input)
  69.         end
  70.     end)
  71. end
  72.  
  73. local function RemoveSpaces(str)
  74.     return str:gsub(" ", "")
  75. end
  76.  
  77. coroutine.wrap(function()
  78.     while wait() do
  79.         RainbowModeColorValue = RainbowModeColorValue + 1/255
  80.         if RainbowModeColorValue >= 1 then
  81.             RainbowModeColorValue = 0
  82.         end
  83.     end
  84. end)()
  85.  
  86.  
  87. local Library = {}
  88.  
  89. function Library:NewWindow(name)
  90.     local Window = Instance.new("ImageLabel")
  91.     local Topbar = Instance.new("Frame")
  92.     local WindowToggle = Instance.new("TextButton")
  93.     local WindowTitle = Instance.new("TextLabel")
  94.     local BottomRoundCover = Instance.new("Frame")
  95.     local Body = Instance.new("ImageLabel")
  96.     local Sorter = Instance.new("UIListLayout")
  97.     local TopbarBodyCover = Instance.new("Frame")
  98.  
  99.     local WindowName = RemoveSpaces(name)
  100.  
  101.     WindowPosition = WindowPosition + 2
  102.  
  103.     local BodyYSize = 35
  104.     local IsTabOpen = true
  105.  
  106.     local function ExtendBodySize(value)
  107.         BodyYSize = BodyYSize + value
  108.  
  109.         TweenService:Create(Body, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 170, 0, BodyYSize)}):Play()
  110.     end
  111.  
  112.     local function UnExtendBodySize(value)
  113.         BodyYSize = BodyYSize - value
  114.  
  115.         TweenService:Create(Body, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 170, 0, BodyYSize)}):Play()
  116.     end
  117.  
  118.    
  119.     Window.Name = (WindowName .. "Window")
  120.     Window.Parent = Container
  121.     Window.BackgroundColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
  122.     Window.BackgroundTransparency = 1
  123.     Window.Position = UDim2.new(WindowPosition, -100, 3, -265)
  124.     Window.Size = UDim2.new(0, 170, 0, 30)
  125.     Window.ZIndex = 2
  126.     Window.Image = "rbxassetid://3570695787"
  127.     Window.ImageColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
  128.     Window.ScaleType = Enum.ScaleType.Slice
  129.     Window.SliceCenter = Rect.new(100, 100, 100, 100)
  130.     Window.SliceScale =  0.05
  131.  
  132.     Topbar.Name = "Topbar"
  133.     Topbar.Parent = Window
  134.     Topbar.BackgroundColor3 = Color3.new(1, 1, 1)
  135.     Topbar.BackgroundTransparency = 1
  136.     Topbar.BorderSizePixel = 0
  137.     Topbar.Size = UDim2.new(0, 170, 0, 30)
  138.     Topbar.ZIndex = 2
  139.  
  140.     WindowToggle.Name = "WindowToggle"
  141.     WindowToggle.Parent = Topbar
  142.     WindowToggle.BackgroundColor3 = Color3.new(1, 1, 1)
  143.     WindowToggle.BackgroundTransparency = 1
  144.     WindowToggle.Position = UDim2.new(0.822450161, 0, 0, 0)
  145.     WindowToggle.Size = UDim2.new(0, 30, 0, 30)
  146.     WindowToggle.ZIndex = 2
  147.     WindowToggle.Font = Enum.Font.SourceSansSemibold
  148.     WindowToggle.Text = "-"
  149.     WindowToggle.TextColor3 = Color3.new(1, 1, 1)
  150.     WindowToggle.TextSize = 20
  151.     WindowToggle.TextWrapped = true
  152.  
  153.     WindowToggle.MouseButton1Down:Connect(function()
  154.         if not IsTabOpen then
  155.             IsTabOpen = true
  156.             TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  157.  
  158.             WindowToggle.Text = "-"
  159.             WindowToggle.TextSize = 20
  160.             WindowToggle.Visible = false
  161.  
  162.             repeat wait() until WindowToggle.TextTransparency == 1
  163.             WindowToggle.Visible = true
  164.             TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  165.         elseif IsTabOpen then
  166.             IsTabOpen = false
  167.             TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  168.            
  169.             WindowToggle.Text = "v"
  170.             WindowToggle.TextSize = 14
  171.             WindowToggle.Visible = false      
  172.  
  173.             repeat wait() until WindowToggle.TextTransparency == 1
  174.             WindowToggle.Visible = true
  175.             TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  176.         end
  177.     end)
  178.  
  179.     WindowTitle.Name = "WindowTitle"
  180.     WindowTitle.Parent = Topbar
  181.     WindowTitle.BackgroundColor3 = Color3.new(1, 1, 1)
  182.     WindowTitle.BackgroundTransparency = 1
  183.     WindowTitle.Size = UDim2.new(0, 170, 0, 30)
  184.     WindowTitle.ZIndex = 2
  185.     WindowTitle.Font = Enum.Font.SourceSansBold
  186.     WindowTitle.Text = name
  187.     WindowTitle.TextColor3 = Color3.new(1, 1, 1)
  188.     WindowTitle.TextSize = 17
  189.  
  190.     BottomRoundCover.Name = "BottomRoundCover"
  191.     BottomRoundCover.Parent = Topbar
  192.     BottomRoundCover.BackgroundColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
  193.     BottomRoundCover.BorderSizePixel = 0
  194.     BottomRoundCover.Position = UDim2.new(0, 0, 0.833333313, 0)
  195.     BottomRoundCover.Size = UDim2.new(0, 170, 0, 5)
  196.     BottomRoundCover.ZIndex = 2
  197.  
  198.     Body.Name = "Body"
  199.     Body.Parent = Window
  200.     Body.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  201.     Body.BackgroundTransparency = 1
  202.     Body.ClipsDescendants = true
  203.     Body.Size = UDim2.new(0, 170, 0, BodyYSize)
  204.     Body.Image = "rbxassetid://3570695787"
  205.     Body.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  206.     Body.ScaleType = Enum.ScaleType.Slice
  207.     Body.SliceCenter = Rect.new(100, 100, 100, 100)
  208.     Body.SliceScale =  0.05
  209.  
  210.     Sorter.Name = "Sorter"
  211.     Sorter.Parent = Body
  212.     Sorter.SortOrder = Enum.SortOrder.LayoutOrder
  213.  
  214.     TopbarBodyCover.Name = "TopbarBodyCover"
  215.     TopbarBodyCover.Parent = Body
  216.     TopbarBodyCover.BackgroundColor3 = Color3.new(1, 1, 1)
  217.     TopbarBodyCover.BackgroundTransparency = 1
  218.     TopbarBodyCover.BorderSizePixel = 0
  219.     TopbarBodyCover.Size = UDim2.new(0, 170, 0, 30)
  220.  
  221.     Dragging(Window)
  222.  
  223.     local Sections = {}
  224.  
  225.     function Sections:NewSection(name)
  226.         local Section1Holder = Instance.new("Frame")
  227.         local SectionInfo = Instance.new("Frame")
  228.         local SectionToggle = Instance.new("TextButton")
  229.         local SectionTitle = Instance.new("TextLabel")
  230.         local Layout = Instance.new("UIListLayout")
  231.  
  232.         local SectionName = RemoveSpaces(name)
  233.         local SectionToggleText = "v"
  234.         local SectionYSize = 30
  235.         local IsSectionOpen = false
  236.  
  237.         local function ExtendSectionSize(value)
  238.             SectionYSize = SectionYSize + value
  239.    
  240.             TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 170, 0, SectionYSize)}):Play()
  241.         end
  242.    
  243.         local function UnExtendSectionSize(value)
  244.             SectionYSize = SectionYSize - value
  245.    
  246.             TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 170, 0, SectionYSize)}):Play()
  247.         end
  248.  
  249.         Section1Holder.Name = (SectionName .. "Section")
  250.         Section1Holder.Parent = Body
  251.         Section1Holder.BackgroundColor3 = Color3.new(0.176471, 0.176471, 0.176471)
  252.         Section1Holder.BorderSizePixel = 0
  253.         Section1Holder.ClipsDescendants = true
  254.         Section1Holder.Size = UDim2.new(0, 170, 0, SectionYSize)
  255.        
  256.         ExtendBodySize(30)
  257.  
  258.         SectionInfo.Name = "SectionInfo"
  259.         SectionInfo.Parent = Section1Holder
  260.         SectionInfo.BackgroundColor3 = Color3.new(1, 1, 1)
  261.         SectionInfo.BackgroundTransparency = 1
  262.         SectionInfo.Size = UDim2.new(0, 170, 0, 30)
  263.        
  264.         SectionToggle.Name = "SectionToggle"
  265.         SectionToggle.Parent = SectionInfo
  266.         SectionToggle.BackgroundColor3 = Color3.new(1, 1, 1)
  267.         SectionToggle.BackgroundTransparency = 1
  268.         SectionToggle.Position = UDim2.new(0.822450161, 0, 0, 0)
  269.         SectionToggle.Size = UDim2.new(0, 30, 0, 30)
  270.         SectionToggle.ZIndex = 2
  271.         SectionToggle.Font = Enum.Font.SourceSansSemibold
  272.         SectionToggle.Text = SectionToggleText
  273.         SectionToggle.TextColor3 = Color3.new(1, 1, 1)
  274.         SectionToggle.TextSize = 14
  275.         SectionToggle.TextWrapped = true
  276.        
  277.         SectionTitle.Name = "SectionTitle"
  278.         SectionTitle.Parent = SectionInfo
  279.         SectionTitle.BackgroundColor3 = Color3.new(1, 1, 1)
  280.         SectionTitle.BackgroundTransparency = 1
  281.         SectionTitle.BorderSizePixel = 0
  282.         SectionTitle.Position = UDim2.new(0.052941177, 0, 0, 0)
  283.         SectionTitle.Size = UDim2.new(0, 125, 0, 30)
  284.         SectionTitle.Font = Enum.Font.SourceSansBold
  285.         SectionTitle.Text = name
  286.         SectionTitle.TextColor3 = Color3.new(1, 1, 1)
  287.         SectionTitle.TextSize = 17
  288.         SectionTitle.TextXAlignment = Enum.TextXAlignment.Left
  289.        
  290.         Layout.Name = "Layout"
  291.         Layout.Parent = Section1Holder
  292.         Layout.SortOrder = Enum.SortOrder.LayoutOrder
  293.  
  294.         WindowToggle.MouseButton1Down:Connect(function()
  295.             if not IsTabOpen then
  296.                 ExtendBodySize(30)
  297.                 SectionToggle.Text = SectionToggleText
  298.                 TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  299.             elseif IsTabOpen then
  300.                 UnExtendBodySize(30)
  301.                 SectionToggle.Text = ""
  302.                 TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  303.             end
  304.         end)
  305.  
  306.         SectionToggle.MouseButton1Down:Connect(function()
  307.             if not IsSectionOpen then
  308.                 IsSectionOpen = true
  309.                 SectionToggleText = "-"
  310.  
  311.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  312.                 TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  313.  
  314.                 SectionToggle.Text = SectionToggleText
  315.                 SectionToggle.TextSize = 20
  316.                 SectionToggle.Visible = false
  317.                 WindowToggle.Visible = false
  318.  
  319.                 repeat wait() until SectionToggle.TextTransparency == 1 and WindowToggle.TextTransparency == 1
  320.                 SectionToggle.Visible = true
  321.                 WindowToggle.Visible = true
  322.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  323.                 TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  324.             elseif IsSectionOpen then
  325.                 IsSectionOpen = false
  326.                 SectionToggleText = "v"
  327.  
  328.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  329.                 TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  330.  
  331.                 SectionToggle.Text = SectionToggleText
  332.                 SectionToggle.TextSize = 14
  333.                 SectionToggle.Visible = false
  334.                 WindowToggle.Visible = false
  335.  
  336.                 repeat wait() until SectionToggle.TextTransparency == 1 and WindowToggle.TextTransparency == 1
  337.                 SectionToggle.Visible = true
  338.                 WindowToggle.Visible = true
  339.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  340.                 TweenService:Create(WindowToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  341.             end
  342.         end)
  343.  
  344.         local LibraryElements = {}
  345.  
  346.         function LibraryElements:CreateToggle(name, action)
  347.             local ToggleHolder = Instance.new("Frame")
  348.             local ToggleTitle = Instance.new("TextLabel")
  349.             local ToggleBackground = Instance.new("ImageLabel")
  350.             local ToggleButton = Instance.new("ImageButton")
  351.        
  352.             local ToggleName = RemoveSpaces(name)
  353.             local Toggled = false
  354.  
  355.             ToggleHolder.Name = (ToggleName .. "ToggleHolder")
  356.             ToggleHolder.Parent = Section1Holder
  357.             ToggleHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  358.             ToggleHolder.BorderSizePixel = 0
  359.             ToggleHolder.Size = UDim2.new(0, 170, 0, 30)
  360.        
  361.             ToggleTitle.Name = "ToggleTitle"
  362.             ToggleTitle.Parent = ToggleHolder
  363.             ToggleTitle.BackgroundColor3 = Color3.new(1, 1, 1)
  364.             ToggleTitle.BackgroundTransparency = 1
  365.             ToggleTitle.BorderSizePixel = 0
  366.             ToggleTitle.Position = UDim2.new(0.052941177, 0, 0, 0)
  367.             ToggleTitle.Size = UDim2.new(0, 125, 0, 30)
  368.             ToggleTitle.Font = Enum.Font.SourceSansBold
  369.             ToggleTitle.Text = name
  370.             ToggleTitle.TextColor3 = Color3.new(1, 1, 1)
  371.             ToggleTitle.TextSize = 17
  372.             ToggleTitle.TextXAlignment = Enum.TextXAlignment.Left
  373.        
  374.             ToggleBackground.Name = "ToggleBackground"
  375.             ToggleBackground.Parent = ToggleHolder
  376.             ToggleBackground.BackgroundColor3 = Color3.new(1, 1, 1)
  377.             ToggleBackground.BackgroundTransparency = 1
  378.             ToggleBackground.BorderSizePixel = 0
  379.             ToggleBackground.Position = UDim2.new(0.847058833, 0, 0.166666672, 0)
  380.             ToggleBackground.Size = UDim2.new(0, 20, 0, 20)
  381.             ToggleBackground.Image = "rbxassetid://3570695787"
  382.             ToggleBackground.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  383.        
  384.             ToggleButton.Name = "ToggleButton"
  385.             ToggleButton.Parent = ToggleBackground
  386.             ToggleButton.BackgroundColor3 = Color3.new(1, 1, 1)
  387.             ToggleButton.BackgroundTransparency = 1
  388.             ToggleButton.Position = UDim2.new(0, 2, 0, 2)
  389.             ToggleButton.Size = UDim2.new(0, 16, 0, 16)
  390.             ToggleButton.Image = "rbxassetid://3570695787"
  391.             ToggleButton.ImageColor3 = Color3.new(1, 0.341176, 0.341176)
  392.             ToggleButton.ImageTransparency = 1
  393.  
  394.             ToggleButton.MouseButton1Down:Connect(function()   
  395.                 Toggled = not Toggled
  396.            
  397.                 if Toggled then
  398.                     TweenService:Create(ToggleButton, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  399.                 elseif not Toggled then
  400.                     TweenService:Create(ToggleButton, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  401.                 end
  402.  
  403.                 action(Toggled)
  404.             end)
  405.  
  406.             SectionToggle.MouseButton1Down:Connect(function()
  407.                 if not IsSectionOpen then
  408.                     ExtendSectionSize(30)
  409.                     ExtendBodySize(30)
  410.                 elseif IsSectionOpen then
  411.                     UnExtendSectionSize(30)
  412.                     UnExtendBodySize(30)
  413.                 end
  414.             end)
  415.  
  416.             WindowToggle.MouseButton1Down:Connect(function()
  417.                 if not IsTabOpen then
  418.                     if IsSectionOpen then
  419.                         ExtendBodySize(30)
  420.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 360}):Play()
  421.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  422.                     elseif not IsSectionOpen then
  423.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  424.                     end
  425.  
  426.                    
  427.                 elseif IsTabOpen then
  428.                     if IsSectionOpen then
  429.                         UnExtendBodySize(30)
  430.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  431.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  432.                     elseif not IsSectionOpen then
  433.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  434.                     end
  435.                 end
  436.  
  437.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  438.        
  439.                 SectionToggle.Visible = false
  440.        
  441.                 repeat wait() until SectionToggle.TextTransparency == 1
  442.                 SectionToggle.Visible = true
  443.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  444.             end)
  445.         end
  446.  
  447.         function LibraryElements:CreateSlider(name, minimumvalue, maximumvalue, startvalue, precisevalue, action)
  448.             local SliderHolder = Instance.new("Frame")
  449.             local SliderTitle = Instance.new("TextLabel")
  450.             local SliderValueHolder = Instance.new("ImageLabel")
  451.             local SliderValue = Instance.new("TextLabel")
  452.             local SliderBackground = Instance.new("ImageLabel")
  453.             local Slider = Instance.new("ImageLabel")
  454.  
  455.             local SliderName = RemoveSpaces(name)
  456.             local Dragging = false
  457.             local PreciseSliderValue = precisevalue
  458.  
  459.             SliderHolder.Name = (SliderName .. "SliderHolder")
  460.             SliderHolder.Parent = Section1Holder
  461.             SliderHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  462.             SliderHolder.BorderSizePixel = 0
  463.             SliderHolder.Size = UDim2.new(0, 170, 0, 30)
  464.  
  465.             SliderTitle.Name = "SliderTitle"
  466.             SliderTitle.Parent = SliderHolder
  467.             SliderTitle.BackgroundColor3 = Color3.new(1, 1, 1)
  468.             SliderTitle.BackgroundTransparency = 1
  469.             SliderTitle.BorderSizePixel = 0
  470.             SliderTitle.Position = UDim2.new(0.052941177, 0, 0, 0)
  471.             SliderTitle.Size = UDim2.new(0, 125, 0, 15)
  472.             SliderTitle.Font = Enum.Font.SourceSansSemibold
  473.             SliderTitle.Text = name
  474.             SliderTitle.TextColor3 = Color3.new(1, 1, 1)
  475.             SliderTitle.TextSize = 17
  476.             SliderTitle.TextXAlignment = Enum.TextXAlignment.Left
  477.  
  478.             SliderValueHolder.Name = "SliderValueHolder"
  479.             SliderValueHolder.Parent = SliderHolder
  480.             SliderValueHolder.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  481.             SliderValueHolder.BackgroundTransparency = 1
  482.             SliderValueHolder.Position = UDim2.new(0.747058809, 0, 0, 0)
  483.             SliderValueHolder.Size = UDim2.new(0, 35, 0, 15)
  484.             SliderValueHolder.Image = "rbxassetid://3570695787"
  485.             SliderValueHolder.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  486.             SliderValueHolder.ImageTransparency = 0.5
  487.             SliderValueHolder.ScaleType = Enum.ScaleType.Slice
  488.             SliderValueHolder.SliceCenter = Rect.new(100, 100, 100, 100)
  489.             SliderValueHolder.SliceScale = 0.02
  490.  
  491.             SliderValue.Name = "SliderValue"
  492.             SliderValue.Parent = SliderValueHolder
  493.             SliderValue.BackgroundColor3 = Color3.new(1, 1, 1)
  494.             SliderValue.BackgroundTransparency = 1
  495.             SliderValue.Size = UDim2.new(0, 35, 0, 15)
  496.             SliderValue.Font = Enum.Font.SourceSansSemibold
  497.             SliderValue.Text = tostring(startvalue or PreciseSliderValue and tonumber(string.format("%.2f", startvalue)))
  498.             SliderValue.TextColor3 = Color3.new(1, 1, 1)
  499.             SliderValue.TextSize = 14
  500.  
  501.             SliderBackground.Name = "SliderBackground"
  502.             SliderBackground.Parent = SliderHolder
  503.             SliderBackground.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  504.             SliderBackground.BackgroundTransparency = 1
  505.             SliderBackground.Position = UDim2.new(0.0529999994, 0, 0.649999976, 0)
  506.             SliderBackground.Selectable = true
  507.             SliderBackground.Size = UDim2.new(0, 153, 0, 5)
  508.             SliderBackground.Image = "rbxassetid://3570695787"
  509.             SliderBackground.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  510.             SliderBackground.ImageTransparency = 0.5
  511.             SliderBackground.ScaleType = Enum.ScaleType.Slice
  512.             SliderBackground.SliceCenter = Rect.new(100, 100, 100, 100)
  513.             SliderBackground.ClipsDescendants = true
  514.             SliderBackground.SliceScale = 0.02
  515.  
  516.             Slider.Name = "Slider"
  517.             Slider.Parent = SliderBackground
  518.             Slider.BackgroundColor3 = Color3.new(1, 1, 1)
  519.             Slider.BackgroundTransparency = 1
  520.             Slider.Size = UDim2.new(((startvalue or minimumvalue) - minimumvalue) / (maximumvalue - minimumvalue), 0, 0, 5)
  521.             Slider.Image = "rbxassetid://3570695787"
  522.             Slider.ScaleType = Enum.ScaleType.Slice
  523.             Slider.SliceCenter = Rect.new(100, 100, 100, 100)
  524.             Slider.SliceScale = 0.02
  525.  
  526.             local function Sliding(input)
  527.                 local Pos = UDim2.new(math.clamp((input.Position.X - SliderBackground.AbsolutePosition.X) / SliderBackground.AbsoluteSize.X, 0, 1), 0, 1.15, 0)
  528.                 TweenService:Create(Slider, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = Pos}):Play()
  529.  
  530.                 local NonSliderPreciseValue = math.floor(((Pos.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue)
  531.                 local SliderPreciseValue = ((Pos.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue
  532.    
  533.                 local Value = (PreciseSliderValue and SliderPreciseValue or NonSliderPreciseValue)
  534.                 Value = tonumber(string.format("%.2f", Value))
  535.    
  536.                 SliderValue.Text = tostring(Value)
  537.                 action(Value)
  538.             end
  539.        
  540.             SliderBackground.InputBegan:Connect(function(input)
  541.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  542.                     Dragging = true
  543.                 end
  544.             end)
  545.            
  546.             SliderBackground.InputEnded:Connect(function(input)
  547.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  548.                     Dragging = false
  549.                 end
  550.             end)
  551.            
  552.             SliderBackground.InputBegan:Connect(function(input)
  553.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  554.                     Sliding(input)
  555.                 end
  556.             end)
  557.        
  558.             UserInputService.InputChanged:Connect(function(input)
  559.                 if Dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  560.                     Sliding(input)
  561.                 end
  562.             end)
  563.  
  564.             SectionToggle.MouseButton1Down:Connect(function()
  565.                 if not IsSectionOpen then
  566.                     ExtendSectionSize(30)
  567.                     ExtendBodySize(30)
  568.                 elseif IsSectionOpen then
  569.                     UnExtendSectionSize(30)
  570.                     UnExtendBodySize(30)
  571.                 end
  572.             end)
  573.  
  574.             WindowToggle.MouseButton1Down:Connect(function()
  575.                 if not IsTabOpen then
  576.                     if IsSectionOpen then
  577.                         ExtendBodySize(30)
  578.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 360}):Play()
  579.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  580.                     elseif not IsSectionOpen then
  581.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  582.                     end
  583.  
  584.                    
  585.                 elseif IsTabOpen then
  586.                     if IsSectionOpen then
  587.                         UnExtendBodySize(30)
  588.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  589.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  590.                     elseif not IsSectionOpen then
  591.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  592.                     end
  593.                 end
  594.  
  595.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  596.        
  597.                 SectionToggle.Visible = false
  598.        
  599.                 repeat wait() until SectionToggle.TextTransparency == 1
  600.                 SectionToggle.Visible = true
  601.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  602.             end)
  603.         end
  604.  
  605.         function LibraryElements:CreateColorPicker(name, presetcolor, action)
  606.             local ColorPickerHolder = Instance.new("Frame")
  607.             local RainbowToggleHolder = Instance.new("Frame")
  608.             local RainbowTitle = Instance.new("TextLabel")
  609.             local RainbowBackground = Instance.new("ImageLabel")
  610.             local RainbowToggleButton = Instance.new("ImageButton")
  611.             local ColorPickerTitle = Instance.new("TextLabel")
  612.             local ColorPickerToggle = Instance.new("ImageButton")
  613.             local ColorPickerMain = Instance.new("ImageLabel")
  614.             local ColorValueR = Instance.new("TextLabel")
  615.             local ColorValueRRound = Instance.new("ImageLabel")
  616.             local ColorValueB = Instance.new("TextLabel")
  617.             local ColorValueBRound = Instance.new("ImageLabel")
  618.             local ColorValueG = Instance.new("TextLabel")
  619.             local ColorValueGRound = Instance.new("ImageLabel")
  620.             local RoundHueHolder = Instance.new("ImageLabel")
  621.             local ColorHue = Instance.new("ImageLabel")
  622.             local HueMarker = Instance.new("Frame")
  623.             local RoundSaturationHolder = Instance.new("ImageLabel")
  624.             local ColorSelector = Instance.new("ImageLabel")
  625.             local SaturationMarker = Instance.new("ImageLabel")
  626.  
  627.             local ColorPickerName = RemoveSpaces(name)
  628.  
  629.             ColorPickerZIndex = ColorPickerZIndex + 1
  630.  
  631.             local ColorPickerOpen = false
  632.             local RainbowColorMode = false
  633.            
  634.             local Color = nil
  635.             local ColorValue = 0
  636.             local RainbowColor = nil
  637.  
  638.             ColorPickerHolder.Name = (ColorPickerName .. "ColorPickerHolder")
  639.             ColorPickerHolder.Parent = Section1Holder
  640.             ColorPickerHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  641.             ColorPickerHolder.BorderSizePixel = 0
  642.             ColorPickerHolder.Size = UDim2.new(0, 170, 0, 30)
  643.  
  644.             ColorPickerTitle.Name = "ColorPickerTitle"
  645.             ColorPickerTitle.Parent = ColorPickerHolder
  646.             ColorPickerTitle.BackgroundColor3 = Color3.new(1, 1, 1)
  647.             ColorPickerTitle.BackgroundTransparency = 1
  648.             ColorPickerTitle.BorderSizePixel = 0
  649.             ColorPickerTitle.Position = UDim2.new(0.052941177, 0, 0, 0)
  650.             ColorPickerTitle.Size = UDim2.new(0, 125, 0, 30)
  651.             ColorPickerTitle.Font = Enum.Font.SourceSansBold
  652.             ColorPickerTitle.Text = name
  653.             ColorPickerTitle.TextColor3 = Color3.new(1, 1, 1)
  654.             ColorPickerTitle.TextSize = 17
  655.             ColorPickerTitle.TextXAlignment = Enum.TextXAlignment.Left
  656.            
  657.             ColorPickerToggle.Name = "ColorPickerToggle"
  658.             ColorPickerToggle.Parent = ColorPickerHolder
  659.             ColorPickerToggle.BackgroundColor3 = Color3.new(1, 1, 1)
  660.             ColorPickerToggle.BackgroundTransparency = 1
  661.             ColorPickerToggle.Position = UDim2.new(0.822000027, 0, 0.166999996, 0)
  662.             ColorPickerToggle.Size = UDim2.new(0, 22, 0, 20)
  663.             ColorPickerToggle.Image = "rbxassetid://3570695787"
  664.             ColorPickerToggle.ImageColor3 = presetcolor
  665.             ColorPickerToggle.ScaleType = Enum.ScaleType.Slice
  666.             ColorPickerToggle.SliceCenter = Rect.new(100, 100, 100, 100)
  667.             ColorPickerToggle.SliceScale = 0.04
  668.            
  669.             ColorPickerMain.Name = "ColorPickerMain"
  670.             ColorPickerMain.Parent = ColorPickerHolder
  671.             ColorPickerMain.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  672.             ColorPickerMain.BackgroundTransparency = 1
  673.             ColorPickerMain.ClipsDescendants = true
  674.             ColorPickerMain.BorderSizePixel = 0
  675.             ColorPickerMain.Position = UDim2.new(1.04705882, 0, -1.36666667, 0)
  676.             ColorPickerMain.Size = UDim2.new(0, 0, 0, 175)
  677.             ColorPickerMain.Image = "rbxassetid://3570695787"
  678.             ColorPickerMain.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  679.             ColorPickerMain.ScaleType = Enum.ScaleType.Slice
  680.             ColorPickerMain.SliceCenter = Rect.new(100, 100, 100, 100)
  681.             ColorPickerMain.SliceScale = 0.05
  682.             ColorPickerMain.ZIndex = 1 + ColorPickerZIndex
  683.            
  684.             RainbowToggleHolder.Name = "RainbowToggleHolder"
  685.             RainbowToggleHolder.Parent = ColorPickerMain
  686.             RainbowToggleHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  687.             RainbowToggleHolder.BackgroundTransparency = 1
  688.             RainbowToggleHolder.BorderSizePixel = 0
  689.             RainbowToggleHolder.Position = UDim2.new(0, 0, 0.819999993, 0)
  690.             RainbowToggleHolder.Size = UDim2.new(0, 170, 0, 30)
  691.             RainbowToggleHolder.ZIndex = 1 + ColorPickerZIndex
  692.  
  693.             RainbowTitle.Name = "RainbowTitle"
  694.             RainbowTitle.Parent = RainbowToggleHolder
  695.             RainbowTitle.BackgroundColor3 = Color3.new(1, 1, 1)
  696.             RainbowTitle.BackgroundTransparency = 1
  697.             RainbowTitle.BorderSizePixel = 0
  698.             RainbowTitle.Position = UDim2.new(0.052941177, 0, 0, 0)
  699.             RainbowTitle.Size = UDim2.new(0, 125, 0, 30)
  700.             RainbowTitle.Font = Enum.Font.SourceSansBold
  701.             RainbowTitle.Text = "Rainbow"
  702.             RainbowTitle.TextColor3 = Color3.new(1, 1, 1)
  703.             RainbowTitle.TextSize = 17
  704.             RainbowTitle.TextXAlignment = Enum.TextXAlignment.Left
  705.             RainbowTitle.ZIndex = 1 + ColorPickerZIndex
  706.  
  707.             RainbowBackground.Name = "RainbowBackground"
  708.             RainbowBackground.Parent = RainbowToggleHolder
  709.             RainbowBackground.BackgroundColor3 = Color3.new(1, 1, 1)
  710.             RainbowBackground.BackgroundTransparency = 1
  711.             RainbowBackground.BorderSizePixel = 0
  712.             RainbowBackground.Position = UDim2.new(0.847058833, 0, 0.166666672, 0)
  713.             RainbowBackground.Size = UDim2.new(0, 20, 0, 20)
  714.             RainbowBackground.Image = "rbxassetid://3570695787"
  715.             RainbowBackground.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  716.             RainbowBackground.ZIndex = 1 + ColorPickerZIndex
  717.  
  718.             RainbowToggleButton.Name = "RainbowToggleButton"
  719.             RainbowToggleButton.Parent = RainbowBackground
  720.             RainbowToggleButton.BackgroundColor3 = Color3.new(1, 1, 1)
  721.             RainbowToggleButton.BackgroundTransparency = 1
  722.             RainbowToggleButton.Position = UDim2.new(0, 2, 0, 2)
  723.             RainbowToggleButton.Size = UDim2.new(0, 16, 0, 16)
  724.             RainbowToggleButton.Image = "rbxassetid://3570695787"
  725.             RainbowToggleButton.ImageColor3 = Color3.new(1, 0.341176, 0.341176)
  726.             RainbowToggleButton.ImageTransparency = 1
  727.             RainbowToggleButton.ZIndex = 1 + ColorPickerZIndex
  728.  
  729.             ColorValueR.Name = "ColorValueR"
  730.             ColorValueR.Parent = ColorPickerMain
  731.             ColorValueR.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  732.             ColorValueR.BackgroundTransparency = 1
  733.             ColorValueR.BorderSizePixel = 0
  734.             ColorValueR.ClipsDescendants = true
  735.             ColorValueR.Position = UDim2.new(0, 7, 0, 127)
  736.             ColorValueR.Size = UDim2.new(0, 50, 0, 16)
  737.             ColorValueR.ZIndex = 2 + ColorPickerZIndex
  738.             ColorValueR.Font = Enum.Font.SourceSansBold
  739.             ColorValueR.Text = "R: 000"
  740.             ColorValueR.TextColor3 = Color3.new(1, 1, 1)
  741.             ColorValueR.TextSize = 14
  742.  
  743.             ColorValueRRound.Name = "ColorValueRRound"
  744.             ColorValueRRound.Parent = ColorValueR
  745.             ColorValueRRound.Active = true
  746.             ColorValueRRound.AnchorPoint = Vector2.new(0.5, 0.5)
  747.             ColorValueRRound.BackgroundColor3 = Color3.new(1, 1, 1)
  748.             ColorValueRRound.BackgroundTransparency = 1
  749.             ColorValueRRound.Position = UDim2.new(0.5, 0, 0.5, 0)
  750.             ColorValueRRound.Selectable = true
  751.             ColorValueRRound.Size = UDim2.new(1, 0, 1, 0)
  752.             ColorValueRRound.Image = "rbxassetid://3570695787"
  753.             ColorValueRRound.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  754.             ColorValueRRound.ScaleType = Enum.ScaleType.Slice
  755.             ColorValueRRound.SliceCenter = Rect.new(100, 100, 100, 100)
  756.             ColorValueRRound.SliceScale = 0.04
  757.             ColorValueRRound.ZIndex = 1 + ColorPickerZIndex
  758.  
  759.             ColorValueG.Name = "ColorValueG"
  760.             ColorValueG.Parent = ColorPickerMain
  761.             ColorValueG.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  762.             ColorValueG.BackgroundTransparency = 1
  763.             ColorValueG.BorderSizePixel = 0
  764.             ColorValueG.ClipsDescendants = true
  765.             ColorValueG.Position = UDim2.new(0, 60, 0, 127)
  766.             ColorValueG.Size = UDim2.new(0, 51, 0, 16)
  767.             ColorValueG.ZIndex = 2 + ColorPickerZIndex
  768.             ColorValueG.Font = Enum.Font.SourceSansBold
  769.             ColorValueG.Text = "G: 000"
  770.             ColorValueG.TextColor3 = Color3.new(1, 1, 1)
  771.             ColorValueG.TextSize = 14
  772.  
  773.             ColorValueGRound.Name = "ColorValueGRound"
  774.             ColorValueGRound.Parent = ColorValueG
  775.             ColorValueGRound.Active = true
  776.             ColorValueGRound.AnchorPoint = Vector2.new(0.5, 0.5)
  777.             ColorValueGRound.BackgroundColor3 = Color3.new(1, 1, 1)
  778.             ColorValueGRound.BackgroundTransparency = 1
  779.             ColorValueGRound.Position = UDim2.new(0.5, 0, 0.5, 0)
  780.             ColorValueGRound.Selectable = true
  781.             ColorValueGRound.Size = UDim2.new(1, 0, 1, 0)
  782.             ColorValueGRound.Image = "rbxassetid://3570695787"
  783.             ColorValueGRound.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  784.             ColorValueGRound.ScaleType = Enum.ScaleType.Slice
  785.             ColorValueGRound.SliceCenter = Rect.new(100, 100, 100, 100)
  786.             ColorValueGRound.SliceScale = 0.04
  787.             ColorValueGRound.ZIndex = 1 + ColorPickerZIndex
  788.  
  789.             ColorValueB.Name = "ColorValueB"
  790.             ColorValueB.Parent = ColorPickerMain
  791.             ColorValueB.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  792.             ColorValueB.BackgroundTransparency = 1
  793.             ColorValueB.BorderSizePixel = 0
  794.             ColorValueB.ClipsDescendants = true
  795.             ColorValueB.Position = UDim2.new(0, 114, 0, 127)
  796.             ColorValueB.Size = UDim2.new(0, 50, 0, 16)
  797.             ColorValueB.ZIndex = 2 + ColorPickerZIndex
  798.             ColorValueB.Font = Enum.Font.SourceSansBold
  799.             ColorValueB.Text = "B: 000"
  800.             ColorValueB.TextColor3 = Color3.new(1, 1, 1)
  801.             ColorValueB.TextSize = 14
  802.  
  803.             ColorValueBRound.Name = "ColorValueBRound"
  804.             ColorValueBRound.Parent = ColorValueB
  805.             ColorValueBRound.Active = true
  806.             ColorValueBRound.AnchorPoint = Vector2.new(0.5, 0.5)
  807.             ColorValueBRound.BackgroundColor3 = Color3.new(1, 1, 1)
  808.             ColorValueBRound.BackgroundTransparency = 1
  809.             ColorValueBRound.Position = UDim2.new(0.5, 0, 0.5, 0)
  810.             ColorValueBRound.Selectable = true
  811.             ColorValueBRound.Size = UDim2.new(1, 0, 1, 0)
  812.             ColorValueBRound.Image = "rbxassetid://3570695787"
  813.             ColorValueBRound.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  814.             ColorValueBRound.ScaleType = Enum.ScaleType.Slice
  815.             ColorValueBRound.SliceCenter = Rect.new(100, 100, 100, 100)
  816.             ColorValueBRound.SliceScale = 0.04
  817.             ColorValueBRound.ZIndex = 1 + ColorPickerZIndex
  818.  
  819.             RoundHueHolder.Name = "RoundHueHolder"
  820.             RoundHueHolder.Parent = ColorPickerMain
  821.             RoundHueHolder.BackgroundColor3 = Color3.new(1, 1, 1)
  822.             RoundHueHolder.BackgroundTransparency = 1
  823.             RoundHueHolder.ClipsDescendants = true
  824.             RoundHueHolder.Position = UDim2.new(0, 136, 0, 6)
  825.             RoundHueHolder.Size = UDim2.new(0, 28, 0, 114)
  826.             RoundHueHolder.ZIndex = 2 + ColorPickerZIndex
  827.             RoundHueHolder.Image = "rbxassetid://4695575676"
  828.             RoundHueHolder.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  829.             RoundHueHolder.ScaleType = Enum.ScaleType.Slice
  830.             RoundHueHolder.SliceCenter = Rect.new(128, 128, 128, 128)
  831.             RoundHueHolder.SliceScale = 0.05
  832.  
  833.             ColorHue.Name = "ColorHue"
  834.             ColorHue.Parent = RoundHueHolder
  835.             ColorHue.BackgroundColor3 = Color3.new(1, 1, 1)
  836.             ColorHue.BackgroundTransparency = 1
  837.             ColorHue.BorderSizePixel = 0
  838.             ColorHue.Size = UDim2.new(0, 28, 0, 114)
  839.             ColorHue.Image = "http://www.roblox.com/asset/?id=4801885250"
  840.             ColorHue.ScaleType = Enum.ScaleType.Crop
  841.             ColorHue.ZIndex = 1 + ColorPickerZIndex
  842.  
  843.             HueMarker.Name = "HueMarker"
  844.             HueMarker.Parent = RoundHueHolder
  845.             HueMarker.BackgroundColor3 = Color3.new(0.294118, 0.294118, 0.294118)
  846.             HueMarker.BorderSizePixel = 0
  847.             HueMarker.Position = UDim2.new(-0.25, 0, 0, 0)
  848.             HueMarker.Size = UDim2.new(0, 42, 0, 5)
  849.             HueMarker.ZIndex = 1 + ColorPickerZIndex
  850.  
  851.             RoundSaturationHolder.Name = "RoundSaturationHolder"
  852.             RoundSaturationHolder.Parent = ColorPickerMain
  853.             RoundSaturationHolder.BackgroundColor3 = Color3.new(1, 1, 1)
  854.             RoundSaturationHolder.BackgroundTransparency = 1
  855.             RoundSaturationHolder.ClipsDescendants = true
  856.             RoundSaturationHolder.Position = UDim2.new(0, 7, 0, 6)
  857.             RoundSaturationHolder.Size = UDim2.new(0, 122, 0, 114)
  858.             RoundSaturationHolder.ZIndex = 2 + ColorPickerZIndex
  859.             RoundSaturationHolder.Image = "rbxassetid://4695575676"
  860.             RoundSaturationHolder.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  861.             RoundSaturationHolder.ScaleType = Enum.ScaleType.Slice
  862.             RoundSaturationHolder.SliceCenter = Rect.new(128, 128, 128, 128)
  863.             RoundSaturationHolder.SliceScale = 0.05
  864.  
  865.             ColorSelector.Name = "ColorSelector"
  866.             ColorSelector.Parent = RoundSaturationHolder
  867.             ColorSelector.BackgroundColor3 = presetcolor
  868.             ColorSelector.BorderSizePixel = 0
  869.             ColorSelector.Size = UDim2.new(0, 122, 0, 114)
  870.             ColorSelector.Image = "rbxassetid://4805274903"
  871.             ColorSelector.ZIndex = 1 + ColorPickerZIndex
  872.  
  873.             SaturationMarker.Name = "SaturationMarker"
  874.             SaturationMarker.Parent = RoundSaturationHolder
  875.             SaturationMarker.BackgroundColor3 = Color3.new(1, 1, 1)
  876.             SaturationMarker.BackgroundTransparency = 1
  877.             SaturationMarker.Size = UDim2.new(0, 0, 0, 0)
  878.             SaturationMarker.Image = "http://www.roblox.com/asset/?id=4805639000"
  879.             SaturationMarker.ZIndex = 1 + ColorPickerZIndex
  880.  
  881.             local function SetRGBValues()
  882.                 local RedValue, GreenValue, BlueValue = ColorPickerToggle.ImageColor3.r * 255, ColorPickerToggle.ImageColor3.g * 255, ColorPickerToggle.ImageColor3.b * 255
  883.  
  884.                 ColorValueR.Text = ("R: " .. math.floor(RedValue))
  885.                 ColorValueG.Text = ("G: " .. math.floor(GreenValue))
  886.                 ColorValueB.Text = ("B: " .. math.floor(BlueValue))
  887.             end
  888.  
  889.             SetRGBValues()
  890.  
  891.             ColorPickerToggle.MouseButton1Down:Connect(function()
  892.                 if not ColorPickerOpen then
  893.                     ColorPickerOpen = true
  894.                     Body.ClipsDescendants = false
  895.                     Section1Holder.ClipsDescendants = false
  896.  
  897.                     TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 171, 0, 175)}):Play()
  898.                 elseif ColorPickerOpen then
  899.                     ColorPickerOpen = false
  900.                     TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 175)}):Play()
  901.                 end
  902.             end)
  903.  
  904.             local ColorData = {
  905.                 H = 1;
  906.                 S = 1;
  907.                 V = 1
  908.             }
  909.  
  910.             local Connection1 = nil
  911.             local Connection2 = nil
  912.  
  913.             local function GetXY(frame)
  914.                 local X, Y = Mouse.X - frame.AbsolutePosition.X, Mouse.Y - frame.AbsolutePosition.Y
  915.                 local MaxX, MaxY = frame.AbsoluteSize.X, frame.AbsoluteSize.Y
  916.                 X = math.clamp(X, 0, MaxX)
  917.                 Y = math.clamp(Y, 0, MaxY)
  918.                 return X / MaxX, Y / MaxY
  919.             end
  920.  
  921.             local function GetY(frame)
  922.                 local Y2 = Mouse.Y - frame.AbsolutePosition.Y
  923.                 MaxY2 = frame.AbsoluteSize.Y
  924.                 Y2 = math.clamp(Y2, -10, MaxY2)
  925.                 return Y2 / MaxY2
  926.             end
  927.  
  928.             local function Update()
  929.                 SetRGBValues()
  930.  
  931.                 Color = Color3.fromHSV(ColorData.H, ColorData.S, ColorData.V)
  932.  
  933.                 ColorPickerToggle.ImageColor3 = Color
  934.                 ColorSelector.BackgroundColor3 = Color3.fromHSV(ColorData.H, 1, 1)
  935.                 action(ColorPickerToggle.ImageColor3)
  936.             end
  937.  
  938.             ColorSelector.MouseLeave:Connect(function()
  939.                 if Connection1 then
  940.                     Connection1:Disconnect()
  941.                     Connection1 = nil
  942.                 end
  943.                 if Connection2 then
  944.                     Connection2:Disconnect()
  945.                     Connection2 = nil
  946.                 end
  947.             end)
  948.  
  949.             ColorHue.MouseLeave:Connect(function()
  950.                 if Connection1 then
  951.                     Connection1:Disconnect()
  952.                     Connection1 = nil
  953.                 end
  954.                 if Connection2 then
  955.                     Connection2:Disconnect()
  956.                     Connection2 = nil
  957.                 end
  958.             end)
  959.  
  960.             RainbowToggleButton.MouseButton1Down:Connect(function()
  961.                 if not RainbowColorMode then
  962.                     RainbowColorMode = true
  963.                     TweenService:Create(RainbowToggleButton, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  964.                 elseif RainbowColorMode then
  965.                     RainbowColorMode = false
  966.                     TweenService:Create(RainbowToggleButton, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  967.                 end
  968.  
  969.                 while RainbowColorMode do
  970.                     RainbowColor = Color3.fromHSV(RainbowModeColorValue, 1, 1)
  971.  
  972.                     ColorPickerToggle.ImageColor3 = RainbowColor
  973.                     ColorSelector.BackgroundColor3 = RainbowColor
  974.  
  975.                     action(RainbowColor)
  976.                     SetRGBValues()
  977.                     wait()
  978.                 end
  979.             end)
  980.  
  981.             ColorSelector.InputBegan:Connect(function(input)
  982.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  983.                     if not RainbowColorMode then
  984.                         if Connection1 then
  985.                             Connection1:Disconnect()
  986.                         end
  987.                         Connection1 = RunService.RenderStepped:Connect(function()
  988.                             local X, Y = GetXY(RoundSaturationHolder)
  989.  
  990.                             SaturationMarker.Position = UDim2.new(X, 0, Y, 0)
  991.                             ColorData.S = X
  992.                             ColorData.V = 1 - Y
  993.                             Update()
  994.                         end)
  995.                     end
  996.                 end
  997.             end)
  998.  
  999.             ColorSelector.InputEnded:Connect(function(input)
  1000.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1001.                     if Connection1 then
  1002.                         Connection1:Disconnect()
  1003.                     end
  1004.                 end
  1005.             end)
  1006.  
  1007.             ColorHue.InputBegan:Connect(function(input)
  1008.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1009.                     if not RainbowColorMode then
  1010.                         if Connection2 then
  1011.                             Connection2:Disconnect()
  1012.                         end
  1013.  
  1014.                         Connection2 = RunService.RenderStepped:Connect(function()
  1015.                             local X, Y = GetXY(RoundHueHolder)
  1016.                             local Y2 = GetY(RoundHueHolder)
  1017.  
  1018.                             ColorData.H = 1 - Y
  1019.                             TweenService:Create(HueMarker, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(-0.25, 0, Y2, 0)}):Play()
  1020.                             Update()
  1021.                         end)
  1022.                     end
  1023.                 end
  1024.             end)
  1025.  
  1026.             ColorHue.InputEnded:Connect(function(input)
  1027.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1028.                     if Connection2 then
  1029.                         Connection2:Disconnect()
  1030.                     end
  1031.                 end
  1032.             end)
  1033.  
  1034.             SectionToggle.MouseButton1Down:Connect(function()
  1035.                 if not IsSectionOpen then
  1036.                     Body.ClipsDescendants = true
  1037.                     Section1Holder.ClipsDescendants = true
  1038.  
  1039.                     ExtendSectionSize(30)
  1040.                     ExtendBodySize(30)
  1041.                 elseif IsSectionOpen then
  1042.                     ColorPickerOpen = false
  1043.                     TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 175)}):Play()
  1044.  
  1045.                     Body.ClipsDescendants = true
  1046.                     Section1Holder.ClipsDescendants = true
  1047.  
  1048.                     UnExtendSectionSize(30)
  1049.                     UnExtendBodySize(30)
  1050.                 end
  1051.             end)
  1052.  
  1053.             WindowToggle.MouseButton1Down:Connect(function()
  1054.                 ColorPickerOpen = false
  1055.                 TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 175)}):Play()
  1056.  
  1057.                 Body.ClipsDescendants = true
  1058.                 Section1Holder.ClipsDescendants = true
  1059.  
  1060.                 if not IsTabOpen then
  1061.                     if IsSectionOpen then
  1062.                         ExtendBodySize(30)
  1063.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 360}):Play()
  1064.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1065.                     elseif not IsSectionOpen then
  1066.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1067.                     end
  1068.  
  1069.                    
  1070.                 elseif IsTabOpen then
  1071.                     if IsSectionOpen then
  1072.                         UnExtendBodySize(30)
  1073.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1074.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1075.                     elseif not IsSectionOpen then
  1076.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1077.                     end
  1078.                 end
  1079.  
  1080.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  1081.        
  1082.                 SectionToggle.Visible = false
  1083.        
  1084.                 repeat wait() until SectionToggle.TextTransparency == 1
  1085.                 SectionToggle.Visible = true
  1086.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  1087.             end)
  1088.         end
  1089.  
  1090.         function LibraryElements:CreateButton(name, action)
  1091.             local ButtonHolder = Instance.new("Frame")
  1092.             local Button = Instance.new("TextButton")
  1093.             local ButtonRound = Instance.new("ImageLabel")
  1094.  
  1095.             local ButtonName = RemoveSpaces(name)
  1096.  
  1097.             ButtonHolder.Name = (ButtonName .. "ButtonHolder")
  1098.             ButtonHolder.Parent = Section1Holder
  1099.             ButtonHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  1100.             ButtonHolder.BorderSizePixel = 0
  1101.             ButtonHolder.Size = UDim2.new(0, 170, 0, 30)
  1102.            
  1103.             Button.Name = "Button"
  1104.             Button.Parent = ButtonHolder
  1105.             Button.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  1106.             Button.BackgroundTransparency = 1
  1107.             Button.BorderSizePixel = 0
  1108.             Button.Position = UDim2.new(0.052941177, 0, 0, 0)
  1109.             Button.Size = UDim2.new(0, 153, 0, 24)
  1110.             Button.ZIndex = 2
  1111.             Button.AutoButtonColor = false
  1112.             Button.Font = Enum.Font.SourceSansBold
  1113.             Button.Text = name
  1114.             Button.TextColor3 = Color3.new(1, 1, 1)
  1115.             Button.TextSize = 14
  1116.            
  1117.             ButtonRound.Name = "ButtonRound"
  1118.             ButtonRound.Parent = Button
  1119.             ButtonRound.Active = true
  1120.             ButtonRound.AnchorPoint = Vector2.new(0.5, 0.5)
  1121.             ButtonRound.BackgroundColor3 = Color3.new(1, 1, 1)
  1122.             ButtonRound.BackgroundTransparency = 1
  1123.             ButtonRound.BorderSizePixel = 0
  1124.             ButtonRound.ClipsDescendants = true
  1125.             ButtonRound.Position = UDim2.new(0.5, 0, 0.5, 0)
  1126.             ButtonRound.Selectable = true
  1127.             ButtonRound.Size = UDim2.new(1, 0, 1, 0)
  1128.             ButtonRound.Image = "rbxassetid://3570695787"
  1129.             ButtonRound.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  1130.             ButtonRound.ScaleType = Enum.ScaleType.Slice
  1131.             ButtonRound.SliceCenter = Rect.new(100, 100, 100, 100)
  1132.             ButtonRound.SliceScale = 0.04
  1133.  
  1134.             Button.MouseButton1Down:Connect(function()
  1135.                 action(Button)
  1136.             end)
  1137.            
  1138.             SectionToggle.MouseButton1Down:Connect(function()
  1139.                 if not IsSectionOpen then
  1140.                     ExtendSectionSize(30)
  1141.                     ExtendBodySize(30)
  1142.                 elseif IsSectionOpen then
  1143.                     UnExtendSectionSize(30)
  1144.                     UnExtendBodySize(30)
  1145.                 end
  1146.             end)
  1147.  
  1148.             WindowToggle.MouseButton1Down:Connect(function()
  1149.                 if not IsTabOpen then
  1150.                     if IsSectionOpen then
  1151.                         ExtendBodySize(30)
  1152.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 360}):Play()
  1153.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1154.                     elseif not IsSectionOpen then
  1155.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1156.                     end
  1157.  
  1158.                    
  1159.                 elseif IsTabOpen then
  1160.                     if IsSectionOpen then
  1161.                         UnExtendBodySize(30)
  1162.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1163.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1164.                     elseif not IsSectionOpen then
  1165.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1166.                     end
  1167.                 end
  1168.  
  1169.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  1170.        
  1171.                 SectionToggle.Visible = false
  1172.        
  1173.                 repeat wait() until SectionToggle.TextTransparency == 1
  1174.                 SectionToggle.Visible = true
  1175.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  1176.             end)
  1177.         end
  1178.  
  1179.         function LibraryElements:CreateTextbox(name, action)
  1180.             local TextBoxHolder = Instance.new("Frame")
  1181.             local TextBox = Instance.new("TextBox")
  1182.             local TextBoxRound = Instance.new("ImageLabel")
  1183.  
  1184.             local TextBoxName = RemoveSpaces(name)
  1185.  
  1186.             TextBoxHolder.Name = (TextBoxName .. "TextBoxHolder")
  1187.             TextBoxHolder.Parent = Section1Holder
  1188.             TextBoxHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  1189.             TextBoxHolder.BorderSizePixel = 0
  1190.             TextBoxHolder.Size = UDim2.new(0, 170, 0, 30)
  1191.            
  1192.             TextBox.Parent = TextBoxHolder
  1193.             TextBox.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  1194.             TextBox.BackgroundTransparency = 1
  1195.             TextBox.ClipsDescendants = true
  1196.             TextBox.Position = UDim2.new(0.0529999994, 0, 0, 0)
  1197.             TextBox.Size = UDim2.new(0, 153, 0, 24)
  1198.             TextBox.ZIndex = 2
  1199.             TextBox.Font = Enum.Font.SourceSansBold
  1200.             TextBox.PlaceholderText = name
  1201.             TextBox.Text = ""
  1202.             TextBox.TextColor3 = Color3.new(1, 1, 1)
  1203.             TextBox.TextSize = 14
  1204.            
  1205.             TextBoxRound.Name = "TextBoxRound"
  1206.             TextBoxRound.Parent = TextBox
  1207.             TextBoxRound.Active = true
  1208.             TextBoxRound.AnchorPoint = Vector2.new(0.5, 0.5)
  1209.             TextBoxRound.BackgroundColor3 = Color3.new(1, 1, 1)
  1210.             TextBoxRound.BackgroundTransparency = 1
  1211.             TextBoxRound.BorderSizePixel = 0
  1212.             TextBoxRound.ClipsDescendants = true
  1213.             TextBoxRound.Position = UDim2.new(0.5, 0, 0.5, 0)
  1214.             TextBoxRound.Selectable = true
  1215.             TextBoxRound.Size = UDim2.new(1, 0, 1, 0)
  1216.             TextBoxRound.Image = "rbxassetid://3570695787"
  1217.             TextBoxRound.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  1218.             TextBoxRound.ScaleType = Enum.ScaleType.Slice
  1219.             TextBoxRound.SliceCenter = Rect.new(100, 100, 100, 100)
  1220.             TextBoxRound.SliceScale = 0.04
  1221.  
  1222.             TextBox.FocusLost:Connect(function(enterPressed)
  1223.                 if enterPressed then
  1224.                     action(TextBox.Text)
  1225.                 end
  1226.             end)
  1227.  
  1228.             SectionToggle.MouseButton1Down:Connect(function()
  1229.                 if not IsSectionOpen then
  1230.                     ExtendSectionSize(30)
  1231.                     ExtendBodySize(30)
  1232.                 elseif IsSectionOpen then
  1233.                     UnExtendSectionSize(30)
  1234.                     UnExtendBodySize(30)
  1235.                 end
  1236.             end)
  1237.  
  1238.             WindowToggle.MouseButton1Down:Connect(function()
  1239.                 if not IsTabOpen then
  1240.                     if IsSectionOpen then
  1241.                         ExtendBodySize(30)
  1242.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 360}):Play()
  1243.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1244.                     elseif not IsSectionOpen then
  1245.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1246.                     end
  1247.  
  1248.                    
  1249.                 elseif IsTabOpen then
  1250.                     if IsSectionOpen then
  1251.                         UnExtendBodySize(30)
  1252.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1253.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1254.                     elseif not IsSectionOpen then
  1255.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1256.                     end
  1257.                 end
  1258.  
  1259.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  1260.        
  1261.                 SectionToggle.Visible = false
  1262.        
  1263.                 repeat wait() until SectionToggle.TextTransparency == 1
  1264.                 SectionToggle.Visible = true
  1265.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  1266.             end)
  1267.         end
  1268.  
  1269.         function LibraryElements:CreateDropdown(name, options, presetoption, action)
  1270.             local DropdownHolder = Instance.new("Frame")
  1271.             local DropdownTitle = Instance.new("TextLabel")
  1272.             local DropdownRound = Instance.new("ImageLabel")
  1273.             local DropdownToggle = Instance.new("TextButton")
  1274.             local DropdownMain = Instance.new("ImageLabel")
  1275.             local ScrollingFrame = Instance.new("ScrollingFrame")
  1276.             local ButtonLayout = Instance.new("UIListLayout")
  1277.  
  1278.             local DropdownName = RemoveSpaces(name)
  1279.  
  1280.             local StartingCanvasSize = 1
  1281.             local StartScrollingFrame = false
  1282.  
  1283.             local SelectedOptionName = options[presetoption]
  1284.             local NumberOfOptions = 0
  1285.             local DropdownYSize = 0
  1286.             local IsDropdownWindowOpen = false
  1287.  
  1288.             DropdownHolder.Name = (DropdownName .. "DropdownHolder")
  1289.             DropdownHolder.Parent = Section1Holder
  1290.             DropdownHolder.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  1291.             DropdownHolder.BorderSizePixel = 0
  1292.             DropdownHolder.Size = UDim2.new(0, 170, 0, 30)
  1293.            
  1294.             DropdownTitle.Name = "DropdownTitle"
  1295.             DropdownTitle.Parent = DropdownHolder
  1296.             DropdownTitle.BackgroundColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  1297.             DropdownTitle.BackgroundTransparency = 1
  1298.             DropdownTitle.BorderSizePixel = 0
  1299.             DropdownTitle.Position = UDim2.new(0.0529999994, 0, 0, 0)
  1300.             DropdownTitle.Size = UDim2.new(0, 153, 0, 24)
  1301.             DropdownTitle.ZIndex = 2
  1302.             DropdownTitle.Font = Enum.Font.SourceSansBold
  1303.             DropdownTitle.Text = SelectedOptionName
  1304.             DropdownTitle.TextColor3 = Color3.new(1, 1, 1)
  1305.             DropdownTitle.TextSize = 14
  1306.            
  1307.             DropdownRound.Name = "DropdownRound"
  1308.             DropdownRound.Parent = DropdownTitle
  1309.             DropdownRound.Active = true
  1310.             DropdownRound.AnchorPoint = Vector2.new(0.5, 0.5)
  1311.             DropdownRound.BackgroundColor3 = Color3.new(1, 1, 1)
  1312.             DropdownRound.BackgroundTransparency = 1
  1313.             DropdownRound.BorderSizePixel = 0
  1314.             DropdownRound.ClipsDescendants = true
  1315.             DropdownRound.Position = UDim2.new(0.5, 0, 0.5, 0)
  1316.             DropdownRound.Selectable = true
  1317.             DropdownRound.Size = UDim2.new(1, 0, 1, 0)
  1318.             DropdownRound.Image = "rbxassetid://3570695787"
  1319.             DropdownRound.ImageColor3 = Color3.new(0.254902, 0.254902, 0.254902)
  1320.             DropdownRound.ScaleType = Enum.ScaleType.Slice
  1321.             DropdownRound.SliceCenter = Rect.new(100, 100, 100, 100)
  1322.             DropdownRound.SliceScale = 0.04
  1323.  
  1324.             DropdownToggle.Name = "DropdownToggle"
  1325.             DropdownToggle.Parent = DropdownTitle
  1326.             DropdownToggle.BackgroundColor3 = Color3.new(1, 1, 1)
  1327.             DropdownToggle.BackgroundTransparency = 1
  1328.             DropdownToggle.Position = UDim2.new(0.816928029, 0, 0, 0)
  1329.             DropdownToggle.Size = UDim2.new(0, 28, 0, 24)
  1330.             DropdownToggle.AutoButtonColor = false
  1331.             DropdownToggle.Font = Enum.Font.SourceSansBold
  1332.             DropdownToggle.Text = ">"
  1333.             DropdownToggle.TextColor3 = Color3.new(1, 1, 1)
  1334.             DropdownToggle.TextSize = 15
  1335.            
  1336.             DropdownMain.Name = "DropdownMain"
  1337.             DropdownMain.Parent = DropdownTitle
  1338.             DropdownMain.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  1339.             DropdownMain.BackgroundTransparency = 1
  1340.             DropdownMain.ClipsDescendants = true
  1341.             DropdownMain.Position = UDim2.new(1.09275186, 0, -0.0336658955, 0)
  1342.             DropdownMain.Size = UDim2.new(0, 0, 0, DropdownYSize)
  1343.             DropdownMain.Image = "rbxassetid://3570695787"
  1344.             DropdownMain.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  1345.             DropdownMain.ScaleType = Enum.ScaleType.Slice
  1346.             DropdownMain.SliceCenter = Rect.new(100, 100, 100, 100)
  1347.             DropdownMain.SliceScale = 0.04
  1348.  
  1349.             ScrollingFrame.Parent = DropdownMain
  1350.             ScrollingFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  1351.             ScrollingFrame.BackgroundTransparency = 1
  1352.             ScrollingFrame.BorderSizePixel = 0
  1353.             ScrollingFrame.Size = UDim2.new(0, 153, 0, DropdownYSize)
  1354.             ScrollingFrame.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  1355.             ScrollingFrame.CanvasSize = UDim2.new(0, 0, StartingCanvasSize, 0)
  1356.             ScrollingFrame.ScrollBarThickness = 3
  1357.             ScrollingFrame.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  1358.             ScrollingFrame.ScrollingDirection = "Y"
  1359.  
  1360.             ButtonLayout.Name = "ButtonLayout"
  1361.             ButtonLayout.Parent = ScrollingFrame
  1362.             ButtonLayout.SortOrder = Enum.SortOrder.LayoutOrder
  1363.  
  1364.             for i, v in pairs(options) do
  1365.                 local DropdownOption = Instance.new("TextButton")
  1366.    
  1367.                 NumberOfOptions = NumberOfOptions + 1
  1368.  
  1369.                 local DropdownButtonName = RemoveSpaces(v)
  1370.  
  1371.                 DropdownOption.Name = (DropdownButtonName .. "Button")
  1372.                 DropdownOption.Parent = ScrollingFrame
  1373.                 DropdownOption.BackgroundColor3 = Color3.new(0.215686, 0.215686, 0.215686)
  1374.                 DropdownOption.BackgroundTransparency = 1
  1375.                 DropdownOption.BorderSizePixel = 0
  1376.                 DropdownOption.Position = UDim2.new(0, 0, 0, 0)
  1377.                 DropdownOption.Size = UDim2.new(0, 153, 0, 25)
  1378.                 DropdownOption.AutoButtonColor = false
  1379.                 DropdownOption.Font = Enum.Font.SourceSansBold
  1380.                 DropdownOption.Text = v
  1381.                 DropdownOption.TextColor3 = Color3.new(1, 1, 1)
  1382.                 DropdownOption.TextSize = 14
  1383.  
  1384.                 if NumberOfOptions <= 4 then
  1385.                     DropdownYSize = DropdownYSize + 25
  1386.                     DropdownMain.Size = UDim2.new(0, 0, 0, DropdownYSize)
  1387.                 elseif NumberOfOptions >= 4 then
  1388.                     StartScrollingFrame = true
  1389.                 end
  1390.  
  1391.                 if StartScrollingFrame then
  1392.                     StartingCanvasSize = StartingCanvasSize + 0.25
  1393.                     ScrollingFrame.CanvasSize = UDim2.new(0, 0, StartingCanvasSize, 0)
  1394.                 end
  1395.  
  1396.                 DropdownOption.InputBegan:Connect(function(input)
  1397.                     if input.UserInputType == Enum.UserInputType.MouseMovement then
  1398.                         TweenService:Create(DropdownOption, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5}):Play()
  1399.                     end
  1400.                 end)
  1401.                    
  1402.                 DropdownOption.InputEnded:Connect(function(input)
  1403.                     if input.UserInputType == Enum.UserInputType.MouseMovement then
  1404.                         TweenService:Create(DropdownOption, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1405.                     end
  1406.                 end)
  1407.  
  1408.                 DropdownOption.MouseButton1Down:Connect(function()
  1409.                     SelectedOptionName = v
  1410.                     action(v)
  1411.  
  1412.                     IsDropdownWindowOpen = false
  1413.  
  1414.                     DropdownToggle.Text = ">"
  1415.                     TweenService:Create(DropdownToggle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1416.  
  1417.                     TweenService:Create(DropdownTitle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextColor3 = Color3.new(1, 1, 1)}):Play()
  1418.                     DropdownTitle.Text = SelectedOptionName
  1419.  
  1420.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ScrollBarImageTransparency = 1}):Play()
  1421.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1422.  
  1423.                     TweenService:Create(DropdownMain, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1424.                 end)
  1425.             end
  1426.    
  1427.             DropdownToggle.MouseButton1Down:Connect(function()
  1428.                 if IsDropdownWindowOpen then
  1429.                     IsDropdownWindowOpen = false
  1430.  
  1431.                     DropdownToggle.Text = ">"
  1432.                     TweenService:Create(DropdownToggle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1433.  
  1434.                     TweenService:Create(DropdownTitle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextColor3 = Color3.new(1, 1, 1)}):Play()
  1435.                     DropdownTitle.Text = SelectedOptionName
  1436.  
  1437.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ScrollBarImageTransparency = 1}):Play()
  1438.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1439.  
  1440.                     TweenService:Create(DropdownMain, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1441.                 elseif not IsDropdownWindowOpen then
  1442.                     Body.ClipsDescendants = false
  1443.                     Section1Holder.ClipsDescendants = false
  1444.  
  1445.                     IsDropdownWindowOpen = true
  1446.  
  1447.                     DropdownToggle.Text = "<"
  1448.                     TweenService:Create(DropdownToggle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = -360}):Play()
  1449.  
  1450.                     TweenService:Create(DropdownTitle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextColor3 = Color3.new(0.698039, 0.698039, 0.698039)}):Play()
  1451.                     DropdownTitle.Text = name
  1452.  
  1453.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ScrollBarImageTransparency = 0}):Play()
  1454.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 153, 0, DropdownYSize)}):Play()
  1455.  
  1456.                     TweenService:Create(DropdownMain, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 153, 0, DropdownYSize)}):Play()
  1457.                 end
  1458.             end)
  1459.  
  1460.             SectionToggle.MouseButton1Down:Connect(function()
  1461.                 if not IsSectionOpen then
  1462.                     ExtendSectionSize(30)
  1463.                     ExtendBodySize(30)
  1464.                 elseif IsSectionOpen then
  1465.                     IsDropdownWindowOpen = false
  1466.  
  1467.                     DropdownToggle.Text = ">"
  1468.                     TweenService:Create(DropdownToggle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1469.  
  1470.                     TweenService:Create(DropdownTitle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextColor3 = Color3.new(1, 1, 1)}):Play()
  1471.                     DropdownTitle.Text = SelectedOptionName
  1472.  
  1473.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ScrollBarImageTransparency = 1}):Play()
  1474.                     TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0)}):Play()
  1475.  
  1476.                     TweenService:Create(DropdownMain, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1477.                    
  1478.                     Body.ClipsDescendants = true
  1479.                     Section1Holder.ClipsDescendants = true
  1480.  
  1481.                     UnExtendSectionSize(30)
  1482.                     UnExtendBodySize(30)
  1483.                 end
  1484.             end)
  1485.  
  1486.             WindowToggle.MouseButton1Down:Connect(function()
  1487.                 IsDropdownWindowOpen = false
  1488.  
  1489.                 DropdownToggle.Text = ">"
  1490.                 TweenService:Create(DropdownToggle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1491.  
  1492.                 TweenService:Create(DropdownTitle, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextColor3 = Color3.new(1, 1, 1)}):Play()
  1493.  
  1494.                 DropdownTitle.Text = SelectedOptionName
  1495.                 TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {ScrollBarImageTransparency = 1}):Play()
  1496.                 TweenService:Create(ScrollingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1497.  
  1498.                 TweenService:Create(DropdownMain, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, DropdownYSize)}):Play()
  1499.                
  1500.                 Body.ClipsDescendants = true
  1501.                 Section1Holder.ClipsDescendants = true
  1502.  
  1503.                 if not IsTabOpen then
  1504.                     if IsSectionOpen then
  1505.                         ExtendBodySize(30)
  1506.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = -360}):Play()
  1507.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1508.                     elseif not IsSectionOpen then
  1509.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1510.                     end
  1511.  
  1512.                    
  1513.                 elseif IsTabOpen then
  1514.                     if IsSectionOpen then
  1515.                         UnExtendBodySize(30)
  1516.                         TweenService:Create(SectionToggle, TweenInfo.new(0, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Rotation = 0}):Play()
  1517.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1518.                     elseif not IsSectionOpen then
  1519.                         TweenService:Create(Section1Holder, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1520.                     end
  1521.                 end
  1522.  
  1523.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  1524.        
  1525.                 SectionToggle.Visible = false
  1526.        
  1527.                 repeat wait() until SectionToggle.TextTransparency == 1
  1528.                 SectionToggle.Visible = true
  1529.                 TweenService:Create(SectionToggle, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  1530.             end)
  1531.         end
  1532.  
  1533.         return LibraryElements
  1534.     end
  1535.  
  1536.     return Sections
  1537. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement