Advertisement
Peak7550

yun.gay ui library

Aug 15th, 2022 (edited)
992
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 152.38 KB | None | 0 0
  1. local folderName = ... or "float"
  2.  
  3. if not isfolder(folderName) then
  4.     makefolder(folderName)
  5. end
  6.  
  7. local gameConfigFolder = folderName .. "/" .. game.PlaceId
  8.  
  9. if not isfolder(gameConfigFolder) then
  10.     makefolder(gameConfigFolder)
  11. end
  12.  
  13. local inputService = game:GetService("UserInputService")
  14. local tweenService = game:GetService("TweenService")
  15. local runService = game:GetService("RunService")
  16. local coreGui = game:GetService("CoreGui")
  17.  
  18. local utility = {}
  19.  
  20. function utility.create(class, properties)
  21.     properties = properties or {}
  22.  
  23.     local obj = Instance.new(class)
  24.  
  25.     local forcedProperties = {
  26.         AutoButtonColor = false
  27.     }
  28.  
  29.     for prop, v in next, properties do
  30.         obj[prop] = v
  31.     end
  32.  
  33.     for prop, v in next, forcedProperties do
  34.         pcall(
  35.             function()
  36.                 obj[prop] = v
  37.             end
  38.         )
  39.     end
  40.  
  41.     return obj
  42. end
  43.  
  44. function utility.change_color(color, amount)
  45.     local r = math.clamp(math.floor(color.r * 255) + amount, 0, 255)
  46.     local g = math.clamp(math.floor(color.g * 255) + amount, 0, 255)
  47.     local b = math.clamp(math.floor(color.b * 255) + amount, 0, 255)
  48.  
  49.     return Color3.fromRGB(r, g, b)
  50. end
  51.  
  52. function utility.get_rgb(color)
  53.     local r = math.floor(color.r * 255)
  54.     local g = math.floor(color.g * 255)
  55.     local b = math.floor(color.b * 255)
  56.  
  57.     return r, g, b
  58. end
  59.  
  60. function utility.tween(obj, info, properties, callback)
  61.     local anim = tweenService:Create(obj, TweenInfo.new(unpack(info)), properties)
  62.     anim:Play()
  63.  
  64.     if callback then
  65.         anim.Completed:Connect(callback)
  66.     end
  67. end
  68.  
  69. function utility.drag(obj, dragSpeed)
  70.     local start, objPosition, dragging
  71.  
  72.     obj.InputBegan:Connect(
  73.         function(input)
  74.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  75.                 dragging = true
  76.                 start = input.Position
  77.                 objPosition = obj.Position
  78.             end
  79.         end
  80.     )
  81.  
  82.     obj.InputEnded:Connect(
  83.         function(input)
  84.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  85.                 dragging = false
  86.             end
  87.         end
  88.     )
  89.  
  90.     inputService.InputChanged:Connect(
  91.         function(input)
  92.             if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
  93.                 utility.tween(
  94.                     obj,
  95.                     {dragSpeed},
  96.                     {
  97.                         Position = UDim2.new(
  98.                             objPosition.X.Scale,
  99.                             objPosition.X.Offset + (input.Position - start).X,
  100.                             objPosition.Y.Scale,
  101.                             objPosition.Y.Offset + (input.Position - start).Y
  102.                         )
  103.                     }
  104.                 )
  105.             end
  106.         end
  107.     )
  108. end
  109.  
  110. function utility.get_center(sizeX, sizeY)
  111.     return UDim2.new(0.5, -(sizeX / 2), 0.5, -(sizeY / 2))
  112. end
  113.  
  114. function utility.hex_to_rgb(hex)
  115.     return Color3.fromRGB(
  116.         tonumber("0x" .. hex:sub(2, 3)),
  117.         tonumber("0x" .. hex:sub(4, 5)),
  118.         tonumber("0x" .. hex:sub(6, 7))
  119.     )
  120. end
  121.  
  122. function utility.rgb_to_hex(color)
  123.     return string.format(
  124.         "#%02X%02X%02X",
  125.         math.clamp(color.R * 255, 0, 255),
  126.         math.clamp(color.G * 255, 0, 255),
  127.         math.clamp(color.B * 255, 0, 255)
  128.     )
  129. end
  130.  
  131. function utility.table(tbl)
  132.     local oldtbl = tbl or {}
  133.     local newtbl = {}
  134.     local formattedtbl = {}
  135.  
  136.     for option, v in next, oldtbl do
  137.         newtbl[option:lower()] = v
  138.     end
  139.  
  140.     setmetatable(
  141.         formattedtbl,
  142.         {
  143.             __newindex = function(t, k, v)
  144.                 rawset(newtbl, k:lower(), v)
  145.             end,
  146.             __index = function(t, k, v)
  147.                 return newtbl[k:lower()]
  148.             end
  149.         }
  150.     )
  151.  
  152.     return formattedtbl
  153. end
  154.  
  155. local library =
  156.     utility.table {
  157.     flags = {},
  158.     toggled = true,
  159.     color = Color3.fromRGB(255, 20, 88),
  160.     keybind = Enum.KeyCode.P,
  161.     dragSpeed = 0.1
  162. }
  163.  
  164. local coloredGradients = {}
  165.  
  166. function library:SetColor(color)
  167.     for _, obj in next, coloredGradients do
  168.         obj.Color =
  169.             ColorSequence.new {
  170.             ColorSequenceKeypoint.new(0, color),
  171.             ColorSequenceKeypoint.new(1, utility.change_color(color, -49))
  172.         }
  173.     end
  174.  
  175.     library.color = color
  176. end
  177.  
  178. local gui = utility.create("ScreenGui")
  179.  
  180. local lib_open_con = inputService.InputBegan:Connect(
  181.     function(input)
  182.         if input.KeyCode == library.keybind then
  183.             library.toggled = not library.toggled
  184.             gui.Enabled = library.toggled
  185.         end
  186.     end
  187. )
  188.  
  189. function library:Unload()
  190.     lib_open_con:Disconnect()
  191.     gui:Destroy()
  192. end
  193.  
  194. if syn and syn.protect_gui then
  195.     syn.protect_gui(gui)
  196. end
  197.  
  198. gui.Parent = coreGui
  199.  
  200. local flags = {
  201.     toggles = {},
  202.     boxes = {},
  203.     sliders = {},
  204.     dropdowns = {},
  205.     multidropdowns = {},
  206.     keybinds = {},
  207.     colorpickers = {}
  208. }
  209.  
  210. function library:LoadConfig(file)
  211.     local str = readfile(gameConfigFolder .. "/" .. file .. ".cfg")
  212.     local tbl = loadstring(str)()
  213.  
  214.     for flag, value in next, tbl.toggles do
  215.         flags.toggles[flag](value)
  216.     end
  217.  
  218.     for flag, value in next, tbl.boxes do
  219.         flags.boxes[flag](value)
  220.     end
  221.  
  222.     for flag, value in next, tbl.sliders do
  223.         flags.sliders[flag](value)
  224.     end
  225.  
  226.     for flag, value in next, tbl.dropdowns do
  227.         flags.dropdowns[flag](value)
  228.     end
  229.  
  230.     for flag, value in next, tbl.multidropdowns do
  231.         flags.multidropdowns[flag](value)
  232.     end
  233.  
  234.     for flag, value in next, tbl.keybinds do
  235.         flags.keybinds[flag](value)
  236.     end
  237.  
  238.     for flag, value in next, tbl.colorpickers do
  239.         flags.colorpickers[flag](value)
  240.     end
  241. end
  242.  
  243. function library:SaveConfig(name)
  244.     local configstr = "{toggles={"
  245.     local count = 0
  246.  
  247.     for flag, _ in next, flags.toggles do
  248.         count = count + 1
  249.         configstr = configstr .. "['" .. flag .. "']=" .. tostring(library.flags[flag]) .. ","
  250.     end
  251.  
  252.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},boxes={"
  253.  
  254.     count = 0
  255.     for flag, _ in next, flags.boxes do
  256.         count = count + 1
  257.         configstr = configstr .. "['" .. flag .. "']='" .. tostring(library.flags[flag]) .. "',"
  258.     end
  259.  
  260.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},sliders={"
  261.  
  262.     count = 0
  263.     for flag, _ in next, flags.sliders do
  264.         count = count + 1
  265.         configstr = configstr .. "['" .. flag .. "']=" .. tostring(library.flags[flag]) .. ","
  266.     end
  267.  
  268.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},dropdowns={"
  269.  
  270.     count = 0
  271.     for flag, _ in next, flags.dropdowns do
  272.         count = count + 1
  273.         configstr = configstr .. "['" .. flag .. "']='" .. tostring(library.flags[flag]) .. "',"
  274.     end
  275.  
  276.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},multidropdowns={"
  277.  
  278.     count = 0
  279.     for flag, _ in next, flags.multidropdowns do
  280.         count = count + 1
  281.         configstr = configstr .. "['" .. flag .. "']={'" .. table.concat(library.flags[flag], "','") .. "'},"
  282.     end
  283.  
  284.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},keybinds={"
  285.  
  286.     count = 0
  287.     for flag, _ in next, flags.keybinds do
  288.         count = count + 1
  289.         configstr = configstr .. "['" .. flag .. "']=" .. tostring(library.flags[flag]) .. ","
  290.     end
  291.  
  292.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},colorpickers={"
  293.  
  294.     count = 0
  295.     for flag, _ in next, flags.colorpickers do
  296.         count = count + 1
  297.         configstr = configstr .. "['" .. flag .. "']=Color3.new(" .. tostring(library.flags[flag]) .. "),"
  298.     end
  299.  
  300.     configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "}}"
  301.  
  302.     writefile(gameConfigFolder .. "/" .. name .. ".cfg", "return " .. configstr)
  303. end
  304.  
  305. function library:Load(opts)
  306.     local options = utility.table(opts)
  307.     local name = options.name or "Epic UI Library"
  308.     local sizeX = options.sizeX or 466
  309.     local sizeY = options.sizeY or 350
  310.     local color = options.color or Color3.fromRGB(255, 255, 255)
  311.     local dragSpeed = options.dragSpeed or 0
  312.  
  313.     library.color = color
  314.  
  315.     local topbar =
  316.         utility.create(
  317.         "Frame",
  318.         {
  319.             ZIndex = 2,
  320.             Size = UDim2.new(0, sizeX, 0, 26),
  321.             Position = utility.get_center(sizeX, sizeY),
  322.             BorderSizePixel = 0,
  323.             BackgroundColor3 = Color3.fromRGB(22, 22, 22),
  324.             Parent = gui
  325.         }
  326.     )
  327.  
  328.     utility.drag(topbar, dragSpeed)
  329.  
  330.     utility.create(
  331.         "TextLabel",
  332.         {
  333.             ZIndex = 3,
  334.             Size = UDim2.new(0, 0, 1, 0),
  335.             BackgroundTransparency = 1,
  336.             Position = UDim2.new(0, 8, 0, 0),
  337.             FontSize = Enum.FontSize.Size14,
  338.             TextSize = 14,
  339.             TextColor3 = Color3.fromRGB(255, 255, 255),
  340.             Text = name,
  341.             Font = Enum.Font.GothamSemibold,
  342.             TextXAlignment = Enum.TextXAlignment.Left,
  343.             Parent = topbar
  344.         }
  345.     )
  346.  
  347.     local main =
  348.         utility.create(
  349.         "Frame",
  350.         {
  351.             Size = UDim2.new(1, 0, 0, 350),
  352.             BorderColor3 = Color3.fromRGB(20, 20, 20),
  353.             BackgroundColor3 = Color3.fromRGB(32, 32, 32),
  354.             Parent = topbar
  355.         }
  356.     )
  357.  
  358.     local tabs =
  359.         utility.create(
  360.         "Frame",
  361.         {
  362.             ZIndex = 2,
  363.             Size = UDim2.new(1, -8, 1, -64),
  364.             BackgroundTransparency = 1,
  365.             Position = UDim2.new(0, 4, 0, 58),
  366.             BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  367.             Parent = main
  368.         }
  369.     )
  370.  
  371.     local tabToggles =
  372.         utility.create(
  373.         "Frame",
  374.         {
  375.             ZIndex = 2,
  376.             Size = UDim2.new(1, 0, 0, 26),
  377.             BorderColor3 = Color3.fromRGB(20, 20, 20),
  378.             Position = UDim2.new(0, 0, 0, 26),
  379.             BackgroundColor3 = Color3.fromRGB(26, 26, 26),
  380.             Parent = main
  381.         }
  382.     )
  383.  
  384.     local tabTogglesHolder =
  385.         utility.create(
  386.         "Frame",
  387.         {
  388.             Size = UDim2.new(1, -12, 1, 0),
  389.             Position = UDim2.new(0, 6, 0, 0),
  390.             Parent = tabToggles
  391.         }
  392.     )
  393.  
  394.     utility.create(
  395.         "UIListLayout",
  396.         {
  397.             FillDirection = Enum.FillDirection.Horizontal,
  398.             SortOrder = Enum.SortOrder.LayoutOrder,
  399.             Padding = UDim.new(0, 4),
  400.             Parent = tabTogglesHolder
  401.         }
  402.     )
  403.  
  404.     local windowTypes = utility.table({count = 0})
  405.  
  406.     function windowTypes:Show()
  407.         gui.Enabled = true
  408.     end
  409.  
  410.     function windowTypes:Hide()
  411.         gui.Enabled = false
  412.     end
  413.  
  414.     function windowTypes:Tab(name)
  415.         windowTypes.count = windowTypes.count + 1
  416.         name = name or "Tab"
  417.  
  418.         local toggled = windowTypes.count == 1
  419.  
  420.         local tabToggle =
  421.             utility.create(
  422.             "TextButton",
  423.             {
  424.                 ZIndex = 3,
  425.                 BackgroundTransparency = 1,
  426.                 BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  427.                 FontSize = Enum.FontSize.Size14,
  428.                 TextSize = 14,
  429.                 TextColor3 = Color3.fromRGB(255, 255, 255),
  430.                 Text = name,
  431.                 Font = toggled and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  432.                 Parent = tabTogglesHolder
  433.             }
  434.         )
  435.  
  436.         tabToggle.Size = UDim2.new(0, tabToggle.TextBounds.X + 12, 1, 0)
  437.  
  438.         local tab =
  439.             utility.create(
  440.             "Frame",
  441.             {
  442.                 Size = UDim2.new(1, 0, 1, 0),
  443.                 BackgroundTransparency = 1,
  444.                 BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  445.                 Visible = toggled,
  446.                 Parent = tabs
  447.             }
  448.         )
  449.  
  450.         local column1 =
  451.             utility.create(
  452.             "ScrollingFrame",
  453.             {
  454.                 Size = UDim2.new(0.5, -2, 1, 0),
  455.                 BackgroundTransparency = 1,
  456.                 Active = true,
  457.                 BorderSizePixel = 0,
  458.                 BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  459.                 ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0),
  460.                 ScrollBarImageTransparency = 1,
  461.                 ScrollBarThickness = 0,
  462.                 Parent = tab
  463.             }
  464.         )
  465.  
  466.         local column1List =
  467.             utility.create(
  468.             "UIListLayout",
  469.             {
  470.                 SortOrder = Enum.SortOrder.LayoutOrder,
  471.                 Padding = UDim.new(0, 6),
  472.                 Parent = column1
  473.             }
  474.         )
  475.  
  476.         column1List:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(
  477.             function()
  478.                 column1.CanvasSize = UDim2.new(0, 0, 0, column1List.AbsoluteContentSize.Y)
  479.             end
  480.         )
  481.  
  482.         local column2 =
  483.             utility.create(
  484.             "ScrollingFrame",
  485.             {
  486.                 Size = UDim2.new(0.5, -2, 1, 0),
  487.                 BackgroundTransparency = 1,
  488.                 Position = UDim2.new(0.5, 2, 0, 0),
  489.                 Active = true,
  490.                 BorderSizePixel = 0,
  491.                 BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  492.                 ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0),
  493.                 ScrollBarImageTransparency = 1,
  494.                 ScrollBarThickness = 0,
  495.                 CanvasPosition = Vector2.new(0, 150),
  496.                 Parent = tab
  497.             }
  498.         )
  499.  
  500.         local column2List =
  501.             utility.create(
  502.             "UIListLayout",
  503.             {
  504.                 SortOrder = Enum.SortOrder.LayoutOrder,
  505.                 Padding = UDim.new(0, 6),
  506.                 Parent = column2
  507.             }
  508.         )
  509.  
  510.         column2List:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(
  511.             function()
  512.                 column2.CanvasSize = UDim2.new(0, 0, 0, column2List.AbsoluteContentSize.Y)
  513.             end
  514.         )
  515.  
  516.         local function openTab()
  517.             for _, obj in next, tabTogglesHolder:GetChildren() do
  518.                 if obj:IsA("TextButton") then
  519.                     obj.Font = Enum.Font.Gotham
  520.                 end
  521.             end
  522.  
  523.             tabToggle.Font = Enum.Font.GothamSemibold
  524.  
  525.             for _, obj in next, tabs:GetChildren() do
  526.                 obj.Visible = false
  527.             end
  528.  
  529.             tab.Visible = true
  530.         end
  531.  
  532.         tabToggle.MouseButton1Click:Connect(openTab)
  533.  
  534.         local tabTypes = utility.table()
  535.  
  536.         function tabTypes:Open()
  537.             openTab()
  538.         end
  539.  
  540.         function tabTypes:Section(opts)
  541.             local options = utility.table(opts)
  542.             local name = options.name or "Section"
  543.             local column = options.column or 1
  544.  
  545.             local columnFrame = column == 1 and column1 or column == 2 and column2
  546.  
  547.             local sectionHolder =
  548.                 utility.create(
  549.                 "Frame",
  550.                 {
  551.                     Size = UDim2.new(1, 0, 0, 26),
  552.                     BackgroundTransparency = 1,
  553.                     BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  554.                     Parent = columnFrame
  555.                 }
  556.             )
  557.  
  558.             local section =
  559.                 utility.create(
  560.                 "Frame",
  561.                 {
  562.                     ZIndex = 2,
  563.                     Size = UDim2.new(1, -2, 1, -2),
  564.                     BorderColor3 = Color3.fromRGB(22, 22, 22),
  565.                     Position = UDim2.new(0, 1, 0, 1),
  566.                     BackgroundColor3 = Color3.fromRGB(28, 28, 28),
  567.                     Parent = sectionHolder
  568.                 }
  569.             )
  570.  
  571.             local sectionTopbar =
  572.                 utility.create(
  573.                 "Frame",
  574.                 {
  575.                     ZIndex = 3,
  576.                     Size = UDim2.new(1, 0, 0, 24),
  577.                     BorderSizePixel = 0,
  578.                     BackgroundColor3 = Color3.fromRGB(22, 22, 22),
  579.                     Parent = section
  580.                 }
  581.             )
  582.  
  583.             utility.create(
  584.                 "TextLabel",
  585.                 {
  586.                     ZIndex = 3,
  587.                     Size = UDim2.new(0, 0, 1, 0),
  588.                     BackgroundTransparency = 1,
  589.                     Position = UDim2.new(0, 8, 0, 0),
  590.                     BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  591.                     FontSize = Enum.FontSize.Size14,
  592.                     TextSize = 13,
  593.                     TextColor3 = Color3.fromRGB(255, 255, 255),
  594.                     Text = name,
  595.                     Font = Enum.Font.GothamSemibold,
  596.                     TextXAlignment = Enum.TextXAlignment.Left,
  597.                     Parent = sectionTopbar
  598.                 }
  599.             )
  600.  
  601.             local sectionContent =
  602.                 utility.create(
  603.                 "Frame",
  604.                 {
  605.                     Size = UDim2.new(1, -12, 1, -36),
  606.                     Position = UDim2.new(0, 6, 0, 30),
  607.                     BackgroundTransparency = 1,
  608.                     Parent = section
  609.                 }
  610.             )
  611.  
  612.             local sectionContentList =
  613.                 utility.create(
  614.                 "UIListLayout",
  615.                 {
  616.                     SortOrder = Enum.SortOrder.LayoutOrder,
  617.                     Padding = UDim.new(0, 6),
  618.                     Parent = sectionContent
  619.                 }
  620.             )
  621.  
  622.             sectionContentList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(
  623.                 function()
  624.                     sectionHolder.Size = UDim2.new(1, 0, 0, sectionContentList.AbsoluteContentSize.Y + 38)
  625.                 end
  626.             )
  627.  
  628.             local sectionTypes = utility.table()
  629.  
  630.             function sectionTypes:Show()
  631.                 sectionHolder.Visible = true
  632.             end
  633.  
  634.             function sectionTypes:Hide()
  635.                 sectionHolder.Visible = false
  636.             end
  637.  
  638.             function sectionTypes:Label(text)
  639.                 local label =
  640.                     utility.create(
  641.                     "TextLabel",
  642.                     {
  643.                         ZIndex = 3,
  644.                         Size = UDim2.new(0, 0, 0, 14),
  645.                         BackgroundTransparency = 1,
  646.                         Position = UDim2.new(0, 8, 0, 0),
  647.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  648.                         FontSize = Enum.FontSize.Size14,
  649.                         TextSize = 13,
  650.                         Text = text,
  651.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  652.                         Font = Enum.Font.Gotham,
  653.                         TextXAlignment = Enum.TextXAlignment.Left,
  654.                         Parent = sectionContent
  655.                     }
  656.                 )
  657.  
  658.                 local labelTypes = utility.table()
  659.  
  660.                 function labelTypes:Show()
  661.                     label.Visible = true
  662.                 end
  663.  
  664.                 function labelTypes:Hide()
  665.                     label.Visible = false
  666.                 end
  667.  
  668.                 function labelTypes:Set(str)
  669.                     label.Text = str
  670.                 end
  671.  
  672.                 return labelTypes
  673.             end
  674.  
  675.             function sectionTypes:SpecialLabel(text)
  676.                 local specialLabel =
  677.                     utility.create(
  678.                     "TextLabel",
  679.                     {
  680.                         ZIndex = 5,
  681.                         Size = UDim2.new(1, 0, 0, 14),
  682.                         BackgroundTransparency = 1,
  683.                         Position = UDim2.new(0, 8, 0, 0),
  684.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  685.                         FontSize = Enum.FontSize.Size14,
  686.                         TextSize = 13,
  687.                         Text = text,
  688.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  689.                         Font = Enum.Font.Gotham,
  690.                         Parent = sectionContent
  691.                     }
  692.                 )
  693.  
  694.                 utility.create(
  695.                     "Frame",
  696.                     {
  697.                         ZIndex = 3,
  698.                         Size = UDim2.new(1, 0, 0, 1),
  699.                         Position = UDim2.new(0, 0, 0.5, 1),
  700.                         BorderSizePixel = 0,
  701.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  702.                         Parent = specialLabel
  703.                     }
  704.                 )
  705.  
  706.                 local lineBlock =
  707.                     utility.create(
  708.                     "Frame",
  709.                     {
  710.                         ZIndex = 4,
  711.                         Size = UDim2.new(0, specialLabel.TextBounds.X + 6, 0, 1),
  712.                         Position = UDim2.new(0.5, -((specialLabel.TextBounds.X + 6) / 2), 0.5, 1),
  713.                         BorderSizePixel = 0,
  714.                         BackgroundColor3 = Color3.fromRGB(28, 28, 28),
  715.                         Parent = specialLabel
  716.                     }
  717.                 )
  718.  
  719.                 specialLabel:GetPropertyChangedSignal("TextBounds"):Connect(
  720.                     function()
  721.                         lineBlock.Size = UDim2.new(0, specialLabel.TextBounds.X + 6, 0, 1)
  722.                         lineBlock.Position = UDim2.new(0.5, -((specialLabel.TextBounds.X + 6) / 2), 0.5, 1)
  723.                     end
  724.                 )
  725.  
  726.                 local specialLabelTypes = utility.table()
  727.  
  728.                 function specialLabelTypes:Show()
  729.                     specialLabel.Visible = true
  730.                 end
  731.  
  732.                 function specialLabelTypes:Hide()
  733.                     specialLabel.Visible = false
  734.                 end
  735.  
  736.                 function specialLabelTypes:Set(str)
  737.                     specialLabel.Text = str
  738.                 end
  739.  
  740.                 return specialLabelTypes
  741.             end
  742.  
  743.             function sectionTypes:Button(opts)
  744.                 local options = utility.table(opts)
  745.                 local name = options.name
  746.                 local callback = options.callback
  747.  
  748.                 local button =
  749.                     utility.create(
  750.                     "TextButton",
  751.                     {
  752.                         ZIndex = 3,
  753.                         Size = UDim2.new(1, 0, 0, 16),
  754.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  755.                         Font = Enum.Font.Gotham,
  756.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  757.                         Text = "",
  758.                         TextXAlignment = Enum.TextXAlignment.Left,
  759.                         Parent = sectionContent
  760.                     }
  761.                 )
  762.  
  763.                 utility.create(
  764.                     "UIGradient",
  765.                     {
  766.                         Rotation = 90,
  767.                         Color = ColorSequence.new {
  768.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  769.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  770.                         },
  771.                         Parent = button
  772.                     }
  773.                 )
  774.  
  775.                 local title =
  776.                     utility.create(
  777.                     "TextLabel",
  778.                     {
  779.                         ZIndex = 4,
  780.                         Size = UDim2.new(0, 0, 1, 0),
  781.                         BackgroundTransparency = 1,
  782.                         Position = UDim2.new(0, 8, 0, 0),
  783.                         FontSize = Enum.FontSize.Size14,
  784.                         TextSize = 13,
  785.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  786.                         Text = name,
  787.                         Font = Enum.Font.Gotham,
  788.                         TextXAlignment = Enum.TextXAlignment.Left,
  789.                         Parent = button
  790.                     }
  791.                 )
  792.  
  793.                 local buttonTypes = utility.table()
  794.  
  795.                 button.MouseButton1Click:Connect(
  796.                     function()
  797.                         callback(buttonTypes)
  798.                     end
  799.                 )
  800.  
  801.                 function buttonTypes:Show()
  802.                     button.Visible = true
  803.                 end
  804.  
  805.                 function buttonTypes:Hide()
  806.                     button.Visible = false
  807.                 end
  808.  
  809.                 function buttonTypes:SetName(str)
  810.                     title.Text = str
  811.                 end
  812.  
  813.                 function buttonTypes:SetCallback(func)
  814.                     callback = func
  815.                 end
  816.  
  817.                 return buttonTypes
  818.             end
  819.  
  820.             function sectionTypes:Toggle(opts)
  821.                 local options = utility.table(opts)
  822.                 local name = options.name or "Toggle"
  823.                 local flag = options.flag
  824.                 local callback = options.callback or function()
  825.                     end
  826.  
  827.                 local toggled = false
  828.  
  829.                 if flag then
  830.                     library.flags[flag] = toggled
  831.                 end
  832.  
  833.                 callback(toggled)
  834.  
  835.                 local toggle =
  836.                     utility.create(
  837.                     "TextButton",
  838.                     {
  839.                         Size = UDim2.new(1, 0, 0, 16),
  840.                         BackgroundTransparency = 1,
  841.                         TextColor3 = Color3.fromRGB(0, 0, 0),
  842.                         Font = Enum.Font.SourceSans,
  843.                         Parent = sectionContent
  844.                     }
  845.                 )
  846.  
  847.                 local icon =
  848.                     utility.create(
  849.                     "Frame",
  850.                     {
  851.                         ZIndex = 3,
  852.                         Size = UDim2.new(0, 14, 1, -2),
  853.                         BorderColor3 = Color3.fromRGB(37, 37, 37),
  854.                         Position = UDim2.new(0, 0, 0, 1),
  855.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  856.                         Parent = toggle
  857.                     }
  858.                 )
  859.  
  860.                 local iconGradient =
  861.                     utility.create(
  862.                     "UIGradient",
  863.                     {
  864.                         Rotation = 90,
  865.                         Color = ColorSequence.new {
  866.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  867.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  868.                         },
  869.                         Parent = icon
  870.                     }
  871.                 )
  872.  
  873.                 local title =
  874.                     utility.create(
  875.                     "TextLabel",
  876.                     {
  877.                         ZIndex = 3,
  878.                         Size = UDim2.new(0, 0, 1, 0),
  879.                         BackgroundTransparency = 1,
  880.                         Position = UDim2.new(1, 7, 0, 0),
  881.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  882.                         FontSize = Enum.FontSize.Size14,
  883.                         TextSize = 13,
  884.                         TextColor3 = Color3.fromRGB(180, 180, 180),
  885.                         Text = name,
  886.                         Font = Enum.Font.Gotham,
  887.                         TextXAlignment = Enum.TextXAlignment.Left,
  888.                         Parent = icon
  889.                     }
  890.                 )
  891.  
  892.                 local function toggleToggle()
  893.                     toggled = not toggled
  894.  
  895.                     if toggled then
  896.                         table.insert(coloredGradients, iconGradient)
  897.                     else
  898.                         table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  899.                     end
  900.  
  901.                     local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  902.                     local gradientColor
  903.                     if toggled then
  904.                         gradientColor =
  905.                             ColorSequence.new {
  906.                             ColorSequenceKeypoint.new(0, library.color),
  907.                             ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  908.                         }
  909.                     else
  910.                         gradientColor =
  911.                             ColorSequence.new {
  912.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  913.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  914.                         }
  915.                     end
  916.  
  917.                     iconGradient.Color = gradientColor
  918.                     title.TextColor3 = textColor
  919.  
  920.                     if flag then
  921.                         library.flags[flag] = toggled
  922.                     end
  923.  
  924.                     callback(toggled)
  925.                 end
  926.  
  927.                 toggle.MouseButton1Click:Connect(toggleToggle)
  928.  
  929.                 local toggleTypes = utility.table()
  930.  
  931.                 function toggleTypes:Show()
  932.                     toggle.Visible = true
  933.                 end
  934.  
  935.                 function toggleTypes:Hide()
  936.                     toggle.Visible = false
  937.                 end
  938.  
  939.                 function toggleTypes:SetName(str)
  940.                     title.Text = str
  941.                 end
  942.  
  943.                 function toggleTypes:Toggle(bool)
  944.                     if toggled ~= bool then
  945.                         toggleToggle()
  946.                     end
  947.                 end
  948.  
  949.                 if flag then
  950.                     flags.toggles[flag] = function(bool)
  951.                         if toggled ~= bool then
  952.                             toggleToggle()
  953.                         end
  954.                     end
  955.                 end
  956.  
  957.                 return toggleTypes
  958.             end
  959.  
  960.             function sectionTypes:Box(opts)
  961.                 local options = utility.table(opts)
  962.                 local name = options.name or "Box"
  963.                 local placeholder = options.placeholder or "Box"
  964.                 local default = options.default or ""
  965.                 local boxType = options.type or "string"
  966.                 local flag = options.flag
  967.                 local callback = options.callback or function()
  968.                     end
  969.  
  970.                 boxType = boxType:lower()
  971.  
  972.                 if boxType == "number" then
  973.                     default = default:gsub("%D+", "")
  974.  
  975.                     if flag then
  976.                         library.flags[flag] = tonumber(default)
  977.                     end
  978.  
  979.                     callback(tonumber(default))
  980.                 else
  981.                     if flag then
  982.                         library.flags[flag] = default
  983.                     end
  984.  
  985.                     callback(default)
  986.                 end
  987.  
  988.                 local boxHolder =
  989.                     utility.create(
  990.                     "Frame",
  991.                     {
  992.                         Size = UDim2.new(1, 0, 0, 36),
  993.                         BackgroundTransparency = 1,
  994.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  995.                         Parent = sectionContent
  996.                     }
  997.                 )
  998.  
  999.                 local box =
  1000.                     utility.create(
  1001.                     "TextBox",
  1002.                     {
  1003.                         ZIndex = 4,
  1004.                         Size = UDim2.new(1, 0, 0, 16),
  1005.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  1006.                         BackgroundTransparency = 1,
  1007.                         Position = UDim2.new(0, 0, 1, -16),
  1008.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1009.                         FontSize = Enum.FontSize.Size12,
  1010.                         TextSize = 12,
  1011.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  1012.                         Text = default,
  1013.                         Font = Enum.Font.Gotham,
  1014.                         PlaceholderText = placeholder,
  1015.                         Parent = boxHolder
  1016.                     }
  1017.                 )
  1018.  
  1019.                 local bg =
  1020.                     utility.create(
  1021.                     "Frame",
  1022.                     {
  1023.                         ZIndex = 3,
  1024.                         Size = UDim2.new(1, 0, 1, 0),
  1025.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  1026.                         Position = UDim2.new(0, 0, 0, 0),
  1027.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1028.                         Parent = box
  1029.                     }
  1030.                 )
  1031.  
  1032.                 utility.create(
  1033.                     "UIGradient",
  1034.                     {
  1035.                         Rotation = 90,
  1036.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  1037.                         Parent = bg
  1038.                     }
  1039.                 )
  1040.  
  1041.                 local title =
  1042.                     utility.create(
  1043.                     "TextLabel",
  1044.                     {
  1045.                         ZIndex = 3,
  1046.                         Size = UDim2.new(0, 0, 0, 16),
  1047.                         BackgroundTransparency = 1,
  1048.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1049.                         FontSize = Enum.FontSize.Size14,
  1050.                         TextSize = 13,
  1051.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  1052.                         Text = name,
  1053.                         Font = Enum.Font.Gotham,
  1054.                         TextXAlignment = Enum.TextXAlignment.Left,
  1055.                         Parent = boxHolder
  1056.                     }
  1057.                 )
  1058.  
  1059.                 box:GetPropertyChangedSignal("Text"):Connect(
  1060.                     function()
  1061.                         if boxType == "number" then
  1062.                             box.Text = box.Text:gsub("%D+", "")
  1063.                         end
  1064.                     end
  1065.                 )
  1066.  
  1067.                 local boxTypes = utility.table()
  1068.  
  1069.                 function boxTypes:Show()
  1070.                     boxHolder.Visible = true
  1071.                 end
  1072.  
  1073.                 function boxTypes:Hide()
  1074.                     boxHolder.Visible = false
  1075.                 end
  1076.  
  1077.                 function boxTypes:SetName(str)
  1078.                     title.Text = str
  1079.                 end
  1080.  
  1081.                 function boxTypes:SetPlaceholder(str)
  1082.                     box.PlaceholderText = str
  1083.                 end
  1084.  
  1085.                 function boxTypes:Set(str)
  1086.                     if boxType == "string" then
  1087.                         box.Text = str
  1088.  
  1089.                         if flag then
  1090.                             library.flags[flag] = str
  1091.                         end
  1092.  
  1093.                         callback(str)
  1094.                     else
  1095.                         str = str:gsub("%D+", "")
  1096.                         box.Text = str
  1097.  
  1098.                         if flag then
  1099.                             library.flags[flag] = str
  1100.                         end
  1101.  
  1102.                         callback(tonumber(str))
  1103.                     end
  1104.                 end
  1105.  
  1106.                 box.FocusLost:Connect(
  1107.                     function()
  1108.                         boxTypes:Set(box.Text)
  1109.                     end
  1110.                 )
  1111.  
  1112.                 function boxTypes:SetType(str)
  1113.                     if str:lower() == "number" or str:lower() == "string" then
  1114.                         boxType = str:lower()
  1115.                     end
  1116.                 end
  1117.  
  1118.                 if flag then
  1119.                     flags.boxes[flag] = function(str)
  1120.                         if boxType == "string" then
  1121.                             box.Text = str
  1122.  
  1123.                             if flag then
  1124.                                 library.flags[flag] = str
  1125.                             end
  1126.  
  1127.                             callback(str)
  1128.                         else
  1129.                             str = str:gsub("%D+", "")
  1130.                             box.Text = str
  1131.  
  1132.                             if flag then
  1133.                                 library.flags[flag] = str
  1134.                             end
  1135.  
  1136.                             callback(tonumber(str))
  1137.                         end
  1138.                     end
  1139.                 end
  1140.  
  1141.                 return boxTypes
  1142.             end
  1143.  
  1144.             function sectionTypes:Slider(opts)
  1145.                 local options = utility.table(opts)
  1146.                 local min = options.min or 0
  1147.                 local max = options.max or 100
  1148.                 local valueText = options.valueText or "Slider: [VALUE]/" .. tostring(max)
  1149.                 local default = options.default or math.clamp(0, min, max)
  1150.                 local decimals = options.decimals or 0.1
  1151.                 local flag = options.flag
  1152.                 local callback = options.callback or function()
  1153.                     end
  1154.  
  1155.                 decimals = math.floor(10 ^ decimals)
  1156.  
  1157.                 if flag then
  1158.                     library.flags[flag] = default
  1159.                 end
  1160.  
  1161.                 callback(default)
  1162.  
  1163.                 local value = default
  1164.  
  1165.                 local sliding = false
  1166.  
  1167.                 local slider =
  1168.                     utility.create(
  1169.                     "Frame",
  1170.                     {
  1171.                         ZIndex = 3,
  1172.                         Size = UDim2.new(1, 0, 0, 16),
  1173.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  1174.                         Position = UDim2.new(0, 0, 1, -13),
  1175.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1176.                         Parent = sectionContent
  1177.                     }
  1178.                 )
  1179.  
  1180.                 local fill =
  1181.                     utility.create(
  1182.                     "Frame",
  1183.                     {
  1184.                         ZIndex = 4,
  1185.                         Size = UDim2.new((default - min) / (max - min), 0, 1, 0),
  1186.                         BorderSizePixel = 0,
  1187.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1188.                         Parent = slider
  1189.                     }
  1190.                 )
  1191.  
  1192.                 local fillGradient =
  1193.                     utility.create(
  1194.                     "UIGradient",
  1195.                     {
  1196.                         Rotation = 90,
  1197.                         Color = ColorSequence.new {
  1198.                             ColorSequenceKeypoint.new(0, library.color),
  1199.                             ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  1200.                         },
  1201.                         Parent = fill
  1202.                     }
  1203.                 )
  1204.  
  1205.                 table.insert(coloredGradients, fillGradient)
  1206.  
  1207.                 utility.create(
  1208.                     "UIGradient",
  1209.                     {
  1210.                         Rotation = 90,
  1211.                         Color = ColorSequence.new {
  1212.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  1213.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  1214.                         },
  1215.                         Parent = slider
  1216.                     }
  1217.                 )
  1218.  
  1219.                 local title =
  1220.                     utility.create(
  1221.                     "TextLabel",
  1222.                     {
  1223.                         ZIndex = 5,
  1224.                         Size = UDim2.new(1, 0, 1, 0),
  1225.                         BackgroundTransparency = 1,
  1226.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1227.                         FontSize = Enum.FontSize.Size12,
  1228.                         TextSize = 12,
  1229.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  1230.                         Text = valueText:gsub("%[VALUE%]", tostring(default)),
  1231.                         Font = Enum.Font.Gotham,
  1232.                         Parent = slider
  1233.                     }
  1234.                 )
  1235.  
  1236.                 local function slide(input)
  1237.                     local sizeX =
  1238.                         math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
  1239.                     fill.Size = UDim2.new(sizeX, 0, 1, 0)
  1240.  
  1241.                     value = math.floor((((max - min) * sizeX) + min) * decimals) / decimals
  1242.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1243.  
  1244.                     if flag then
  1245.                         library.flags[flag] = value
  1246.                     end
  1247.  
  1248.                     callback(value)
  1249.                 end
  1250.  
  1251.                 slider.InputBegan:Connect(
  1252.                     function(input)
  1253.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1254.                             sliding = true
  1255.                             slide(input)
  1256.                         end
  1257.                     end
  1258.                 )
  1259.  
  1260.                 slider.InputEnded:Connect(
  1261.                     function(input)
  1262.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1263.                             sliding = false
  1264.                         end
  1265.                     end
  1266.                 )
  1267.  
  1268.                 inputService.InputChanged:Connect(
  1269.                     function(input)
  1270.                         if input.UserInputType == Enum.UserInputType.MouseMovement then
  1271.                             if sliding then
  1272.                                 slide(input)
  1273.                             end
  1274.                         end
  1275.                     end
  1276.                 )
  1277.  
  1278.                 local sliderTypes = utility.table()
  1279.  
  1280.                 function sliderTypes:Show()
  1281.                     slider.Visible = true
  1282.                 end
  1283.  
  1284.                 function sliderTypes:Hide()
  1285.                     slider.Visible = false
  1286.                 end
  1287.  
  1288.                 function sliderTypes:SetValueText(str)
  1289.                     valueText = str
  1290.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1291.                 end
  1292.  
  1293.                 function sliderTypes:Set(num)
  1294.                     num = math.floor(math.clamp(num, min, max) * decimals) / decimals
  1295.                     value = num
  1296.                     fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1297.  
  1298.                     if flag then
  1299.                         library.flags[flag] = value
  1300.                     end
  1301.  
  1302.                     callback(value)
  1303.                 end
  1304.  
  1305.                 function sliderTypes:SetMin(num)
  1306.                     min = num
  1307.                     value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1308.                     fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1309.  
  1310.                     if flag then
  1311.                         library.flags[flag] = value
  1312.                     end
  1313.  
  1314.                     callback(value)
  1315.                 end
  1316.  
  1317.                 function sliderTypes:SetMax(num)
  1318.                     max = num
  1319.                     value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1320.                     fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1321.  
  1322.                     if flag then
  1323.                         library.flags[flag] = value
  1324.                     end
  1325.  
  1326.                     callback(value)
  1327.                 end
  1328.  
  1329.                 if flag then
  1330.                     flags.sliders[flag] = function(num)
  1331.                         sliderTypes:Set(num)
  1332.                     end
  1333.                 end
  1334.  
  1335.                 return sliderTypes
  1336.             end
  1337.  
  1338.             function sectionTypes:ToggleSlider(opts)
  1339.                 local options = utility.table(opts)
  1340.                 local name = options.name or "Toggle Slider"
  1341.                 local min = options.min or 0
  1342.                 local max = options.max or 100
  1343.                 local valueText = options.valueText or "Toggle Slider: [VALUE]/" .. tostring(max)
  1344.                 local default = options.default or math.clamp(0, min, max)
  1345.                 local decimals = options.decimals or 0
  1346.                 local toggleFlag = options.toggleFlag
  1347.                 local sliderFlag = options.sliderFlag
  1348.                 local toggleCallback = options.toggleCallback or function()
  1349.                     end
  1350.                 local sliderCallback = options.sliderCallback or function()
  1351.                     end
  1352.  
  1353.                 decimals = math.floor(10 ^ decimals)
  1354.  
  1355.                 local value = default
  1356.                 local toggled = false
  1357.                 local sliding = false
  1358.  
  1359.                 if sliderFlag then
  1360.                     library.flags[sliderFlag] = default
  1361.                 end
  1362.  
  1363.                 sliderCallback(default)
  1364.  
  1365.                 if toggleFlag then
  1366.                     library.flags[toggleFlag] = toggled
  1367.                 end
  1368.  
  1369.                 toggleCallback(toggled)
  1370.  
  1371.                 local toggleSliderHolder =
  1372.                     utility.create(
  1373.                     "Frame",
  1374.                     {
  1375.                         Size = UDim2.new(1, 0, 0, 35),
  1376.                         BackgroundTransparency = 1,
  1377.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1378.                         Parent = sectionContent
  1379.                     }
  1380.                 )
  1381.  
  1382.                 local slider =
  1383.                     utility.create(
  1384.                     "Frame",
  1385.                     {
  1386.                         ZIndex = 3,
  1387.                         Size = UDim2.new(1, 0, 0, 16),
  1388.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  1389.                         Position = UDim2.new(0, 0, 1, -16),
  1390.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1391.                         Parent = toggleSliderHolder
  1392.                     }
  1393.                 )
  1394.  
  1395.                 local fill =
  1396.                     utility.create(
  1397.                     "Frame",
  1398.                     {
  1399.                         ZIndex = 4,
  1400.                         Size = UDim2.new((default - min) / (max - min), 0, 1, 0),
  1401.                         BorderSizePixel = 0,
  1402.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1403.                         Parent = slider
  1404.                     }
  1405.                 )
  1406.  
  1407.                 local fillGradient =
  1408.                     utility.create(
  1409.                     "UIGradient",
  1410.                     {
  1411.                         Rotation = 90,
  1412.                         Color = ColorSequence.new {
  1413.                             ColorSequenceKeypoint.new(0, library.color),
  1414.                             ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  1415.                         },
  1416.                         Parent = fill
  1417.                     }
  1418.                 )
  1419.  
  1420.                 table.insert(coloredGradients, fillGradient)
  1421.  
  1422.                 utility.create(
  1423.                     "UIGradient",
  1424.                     {
  1425.                         Rotation = 90,
  1426.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  1427.                         Parent = slider
  1428.                     }
  1429.                 )
  1430.  
  1431.                 local title =
  1432.                     utility.create(
  1433.                     "TextLabel",
  1434.                     {
  1435.                         ZIndex = 5,
  1436.                         Size = UDim2.new(1, 0, 1, 0),
  1437.                         BackgroundTransparency = 1,
  1438.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1439.                         FontSize = Enum.FontSize.Size12,
  1440.                         TextSize = 12,
  1441.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  1442.                         Text = valueText:gsub("%[VALUE%]", tostring(default)),
  1443.                         Font = Enum.Font.Gotham,
  1444.                         Parent = slider
  1445.                     }
  1446.                 )
  1447.  
  1448.                 local toggle =
  1449.                     utility.create(
  1450.                     "TextButton",
  1451.                     {
  1452.                         Size = UDim2.new(1, 0, 0, 16),
  1453.                         BackgroundTransparency = 1,
  1454.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1455.                         FontSize = Enum.FontSize.Size14,
  1456.                         TextSize = 14,
  1457.                         TextColor3 = Color3.fromRGB(0, 0, 0),
  1458.                         Font = Enum.Font.SourceSans,
  1459.                         Parent = toggleSliderHolder
  1460.                     }
  1461.                 )
  1462.  
  1463.                 local icon =
  1464.                     utility.create(
  1465.                     "TextButton",
  1466.                     {
  1467.                         ZIndex = 3,
  1468.                         Size = UDim2.new(0, 14, 1, -2),
  1469.                         BorderColor3 = Color3.fromRGB(37, 37, 37),
  1470.                         Position = UDim2.new(0, 0, 0, 1),
  1471.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1472.                         Text = "",
  1473.                         Parent = toggle
  1474.                     }
  1475.                 )
  1476.  
  1477.                 local iconGradient =
  1478.                     utility.create(
  1479.                     "UIGradient",
  1480.                     {
  1481.                         Rotation = 90,
  1482.                         Color = ColorSequence.new {
  1483.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  1484.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  1485.                         },
  1486.                         Parent = icon
  1487.                     }
  1488.                 )
  1489.  
  1490.                 local toggleTitle =
  1491.                     utility.create(
  1492.                     "TextLabel",
  1493.                     {
  1494.                         ZIndex = 3,
  1495.                         Size = UDim2.new(0, 0, 1, 0),
  1496.                         BackgroundTransparency = 1,
  1497.                         Position = UDim2.new(1, 7, 0, 0),
  1498.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1499.                         FontSize = Enum.FontSize.Size14,
  1500.                         TextSize = 13,
  1501.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  1502.                         Text = name,
  1503.                         Font = Enum.Font.Gotham,
  1504.                         TextXAlignment = Enum.TextXAlignment.Left,
  1505.                         Parent = icon
  1506.                     }
  1507.                 )
  1508.  
  1509.                 local function toggleToggle()
  1510.                     toggled = not toggled
  1511.  
  1512.                     if toggled then
  1513.                         table.insert(coloredGradients, iconGradient)
  1514.                     else
  1515.                         table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  1516.                     end
  1517.  
  1518.                     local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  1519.                     local gradientColor
  1520.                     if toggled then
  1521.                         gradientColor =
  1522.                             ColorSequence.new {
  1523.                             ColorSequenceKeypoint.new(0, library.color),
  1524.                             ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  1525.                         }
  1526.                     else
  1527.                         gradientColor =
  1528.                             ColorSequence.new {
  1529.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  1530.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  1531.                         }
  1532.                     end
  1533.  
  1534.                     iconGradient.Color = gradientColor
  1535.                     toggleTitle.TextColor3 = textColor
  1536.  
  1537.                     if toggleFlag then
  1538.                         library.flags[toggleFlag] = toggled
  1539.                     end
  1540.  
  1541.                     toggleCallback(toggled)
  1542.                 end
  1543.  
  1544.                 toggle.MouseButton1Click:Connect(toggleToggle)
  1545.  
  1546.                 local function slide(input)
  1547.                     local sizeX =
  1548.                         math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
  1549.                     fill.Size = UDim2.new(sizeX, 0, 1, 0)
  1550.  
  1551.                     value = math.floor((((max - min) * sizeX) + min) * decimals) / decimals
  1552.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1553.  
  1554.                     if sliderFlag then
  1555.                         library.flags[sliderFlag] = value
  1556.                     end
  1557.  
  1558.                     sliderCallback(value)
  1559.                 end
  1560.  
  1561.                 slider.InputBegan:Connect(
  1562.                     function(input)
  1563.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1564.                             sliding = true
  1565.                             slide(input)
  1566.                         end
  1567.                     end
  1568.                 )
  1569.  
  1570.                 slider.InputEnded:Connect(
  1571.                     function(input)
  1572.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1573.                             sliding = false
  1574.                         end
  1575.                     end
  1576.                 )
  1577.  
  1578.                 inputService.InputChanged:Connect(
  1579.                     function(input)
  1580.                         if input.UserInputType == Enum.UserInputType.MouseMovement then
  1581.                             if sliding then
  1582.                                 slide(input)
  1583.                             end
  1584.                         end
  1585.                     end
  1586.                 )
  1587.  
  1588.                 local toggleSliderTypes = utility.table()
  1589.  
  1590.                 function toggleSliderTypes:Show()
  1591.                     toggleSliderHolder.Visible = true
  1592.                 end
  1593.  
  1594.                 function toggleSliderTypes:Hide()
  1595.                     toggleSliderHolder.Visible = false
  1596.                 end
  1597.  
  1598.                 function toggleSliderTypes:SetValueText(str)
  1599.                     valueText = str
  1600.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1601.                 end
  1602.  
  1603.                 function toggleSliderTypes:Set(num)
  1604.                     num = math.floor(math.clamp(num, min, max) * decimals) / decimals
  1605.                     value = num
  1606.                     fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1607.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1608.  
  1609.                     if sliderFlag then
  1610.                         library.flags[sliderFlag] = value
  1611.                     end
  1612.  
  1613.                     sliderCallback(value)
  1614.                 end
  1615.  
  1616.                 function toggleSliderTypes:SetMin(num)
  1617.                     min = num
  1618.                     value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1619.                     fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1620.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1621.  
  1622.                     if sliderFlag then
  1623.                         library.flags[sliderFlag] = value
  1624.                     end
  1625.  
  1626.                     sliderCallback(value)
  1627.                 end
  1628.  
  1629.                 function toggleSliderTypes:SetMax(num)
  1630.                     max = num
  1631.                     value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1632.                     fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1633.                     title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1634.  
  1635.                     if sliderFlag then
  1636.                         library.flags[sliderFlag] = value
  1637.                     end
  1638.  
  1639.                     sliderCallback(value)
  1640.                 end
  1641.  
  1642.                 function toggleSliderTypes:Toggle(bool)
  1643.                     if toggled ~= bool then
  1644.                         toggleToggle()
  1645.                     end
  1646.                 end
  1647.  
  1648.                 if toggleFlag then
  1649.                     flags.toggles[toggleFlag] = function(bool)
  1650.                         if toggled ~= bool then
  1651.                             toggleToggle()
  1652.                         end
  1653.                     end
  1654.                 end
  1655.  
  1656.                 if sliderFlag then
  1657.                     flags.sliders[sliderFlag] = function(num)
  1658.                         toggleSliderTypes:Set(num)
  1659.                     end
  1660.                 end
  1661.  
  1662.                 return toggleSliderTypes
  1663.             end
  1664.  
  1665.             function sectionTypes:Dropdown(opts)
  1666.                 local options = utility.table(opts)
  1667.                 local name = options.name or "Dropdown"
  1668.                 local content = options.content or {}
  1669.                 local multiChoice = options.multiChoice or false
  1670.                 local default =
  1671.                     options.default or (multiChoice and {} or nil)
  1672.                 local flag = options.flag
  1673.                 local callback = options.callback or function()
  1674.                     end
  1675.  
  1676.                 if flag then
  1677.                     library.flags[flag] = default
  1678.                 end
  1679.                 callback(default)
  1680.  
  1681.                 local opened = false
  1682.  
  1683.                 local current = default
  1684.                 local chosen = {}
  1685.  
  1686.                 local dropdownHolder =
  1687.                     utility.create(
  1688.                     "Frame",
  1689.                     {
  1690.                         Size = UDim2.new(1, 0, 0, 36),
  1691.                         BackgroundTransparency = 1,
  1692.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1693.                         Parent = sectionContent
  1694.                     }
  1695.                 )
  1696.  
  1697.                 local title =
  1698.                     utility.create(
  1699.                     "TextLabel",
  1700.                     {
  1701.                         ZIndex = 3,
  1702.                         Size = UDim2.new(0, 0, 0, 16),
  1703.                         BackgroundTransparency = 1,
  1704.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1705.                         FontSize = Enum.FontSize.Size14,
  1706.                         TextSize = 13,
  1707.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  1708.                         Text = name,
  1709.                         Font = Enum.Font.Gotham,
  1710.                         TextXAlignment = Enum.TextXAlignment.Left,
  1711.                         Parent = dropdownHolder
  1712.                     }
  1713.                 )
  1714.  
  1715.                 local open =
  1716.                     utility.create(
  1717.                     "TextButton",
  1718.                     {
  1719.                         ZIndex = 3,
  1720.                         Size = UDim2.new(1, 0, 0, 16),
  1721.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  1722.                         Position = UDim2.new(0, 0, 0, 20),
  1723.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1724.                         Text = "",
  1725.                         Font = Enum.Font.Gotham,
  1726.                         TextXAlignment = Enum.TextXAlignment.Left,
  1727.                         Parent = dropdownHolder
  1728.                     }
  1729.                 )
  1730.  
  1731.                 utility.create(
  1732.                     "UIGradient",
  1733.                     {
  1734.                         Rotation = 90,
  1735.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  1736.                         Parent = open
  1737.                     }
  1738.                 )
  1739.  
  1740.                 local value =
  1741.                     utility.create(
  1742.                     "TextLabel",
  1743.                     {
  1744.                         ZIndex = 4,
  1745.                         Size = UDim2.new(0, 0, 1, 0),
  1746.                         BackgroundTransparency = 1,
  1747.                         Position = UDim2.new(0, 8, 0, 0),
  1748.                         FontSize = Enum.FontSize.Size12,
  1749.                         TextSize = 12,
  1750.                         TextColor3 = (multiChoice and
  1751.                             (#default > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180))) or
  1752.                             default and Color3.fromRGB(255, 255, 255) or
  1753.                             Color3.fromRGB(180, 180, 180),
  1754.                         Text = multiChoice and (#default > 0 and table.concat(default, ", ") or "NONE") or
  1755.                             (default or "NONE"),
  1756.                         Font = Enum.Font.Gotham,
  1757.                         TextXAlignment = Enum.TextXAlignment.Left,
  1758.                         Parent = open
  1759.                     }
  1760.                 )
  1761.  
  1762.                 local icon =
  1763.                     utility.create(
  1764.                     "ImageLabel",
  1765.                     {
  1766.                         ZIndex = 4,
  1767.                         Size = UDim2.new(0, 14, 0, 14),
  1768.                         Rotation = 180,
  1769.                         BackgroundTransparency = 1,
  1770.                         Position = UDim2.new(1, -16, 0, 1),
  1771.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1772.                         Image = "http://www.roblox.com/asset/?id=8747047318",
  1773.                         Parent = open
  1774.                     }
  1775.                 )
  1776.  
  1777.                 local contentFrame =
  1778.                     utility.create(
  1779.                     "Frame",
  1780.                     {
  1781.                         ZIndex = 10,
  1782.                         Visible = false,
  1783.                         Size = UDim2.new(1, 0, 0, 0),
  1784.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  1785.                         Position = UDim2.new(0, 0, 1, 3),
  1786.                         BackgroundColor3 = Color3.fromRGB(33, 33, 33),
  1787.                         Parent = open
  1788.                     }
  1789.                 )
  1790.  
  1791.                 local contentHolder =
  1792.                     utility.create(
  1793.                     "Frame",
  1794.                     {
  1795.                         Size = UDim2.new(1, 0, 1, -4),
  1796.                         Position = UDim2.new(0, 0, 0, 2),
  1797.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1798.                         Parent = contentFrame
  1799.                     }
  1800.                 )
  1801.  
  1802.                 local contentList =
  1803.                     utility.create(
  1804.                     "UIListLayout",
  1805.                     {
  1806.                         SortOrder = Enum.SortOrder.LayoutOrder,
  1807.                         Parent = contentHolder
  1808.                     }
  1809.                 )
  1810.  
  1811.                 contentList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(
  1812.                     function()
  1813.                         contentFrame.Size = UDim2.new(1, 0, 0, contentList.AbsoluteContentSize.Y + 4)
  1814.                     end
  1815.                 )
  1816.  
  1817.                 local function openDropdown()
  1818.                     opened = not opened
  1819.                     icon.Rotation = opened and 0 or 180
  1820.                     contentFrame.Visible = opened
  1821.                     dropdownHolder.Size =
  1822.                         UDim2.new(
  1823.                         1,
  1824.                         0,
  1825.                         0,
  1826.                         opened and dropdownHolder.AbsoluteSize.Y + contentFrame.AbsoluteSize.Y + 3 or 36
  1827.                     )
  1828.                 end
  1829.  
  1830.                 local function selectObj(obj, padding, bool)
  1831.                     for i, v in next, contentHolder:GetChildren() do
  1832.                         if v:IsA("TextButton") then
  1833.                             v:FindFirstChildOfClass("UIPadding").PaddingLeft = UDim.new(0, 6)
  1834.                             v.Font = Enum.Font.Gotham
  1835.                         end
  1836.                     end
  1837.  
  1838.                     obj.Font = bool and Enum.Font.GothamSemibold or Enum.Font.Gotham
  1839.                     padding.PaddingLeft = bool and UDim.new(0, 10) or UDim.new(0, 6)
  1840.                     value.TextColor3 = bool and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  1841.                 end
  1842.  
  1843.                 local function multiSelectObj(obj, padding, bool)
  1844.                     obj.Font = bool and Enum.Font.GothamSemibold or Enum.Font.Gotham
  1845.                     padding.PaddingLeft = bool and UDim.new(0, 10) or UDim.new(0, 6)
  1846.                 end
  1847.  
  1848.                 open.MouseButton1Click:Connect(openDropdown)
  1849.  
  1850.                 for _, opt in next, content do
  1851.                     local option =
  1852.                         utility.create(
  1853.                         "TextButton",
  1854.                         {
  1855.                             Name = opt,
  1856.                             ZIndex = 11,
  1857.                             Size = UDim2.new(1, 0, 0, 14),
  1858.                             BackgroundTransparency = 1,
  1859.                             BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1860.                             FontSize = Enum.FontSize.Size12,
  1861.                             TextSize = 12,
  1862.                             TextColor3 = Color3.fromRGB(255, 255, 255),
  1863.                             Text = tostring(opt),
  1864.                             Font = current == opt and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  1865.                             TextXAlignment = Enum.TextXAlignment.Left,
  1866.                             Parent = contentHolder
  1867.                         }
  1868.                     )
  1869.  
  1870.                     local optionPadding =
  1871.                         utility.create(
  1872.                         "UIPadding",
  1873.                         {
  1874.                             PaddingLeft = current == opt and UDim.new(0, 10) or UDim.new(0, 6),
  1875.                             Parent = option
  1876.                         }
  1877.                     )
  1878.  
  1879.                     option.MouseButton1Click:Connect(
  1880.                         function()
  1881.                             if not multiChoice then
  1882.                                 if current ~= opt then
  1883.                                     current = opt
  1884.                                     selectObj(option, optionPadding, true)
  1885.                                     value.Text = opt
  1886.  
  1887.                                     if flag then
  1888.                                         library.flags[flag] = opt
  1889.                                     end
  1890.  
  1891.                                     callback(opt)
  1892.                                 else
  1893.                                     current = nil
  1894.                                     selectObj(option, optionPadding, false)
  1895.                                     value.Text = "NONE"
  1896.  
  1897.                                     if flag then
  1898.                                         library.flags[flag] = nil
  1899.                                     end
  1900.  
  1901.                                     callback(nil)
  1902.                                 end
  1903.                             else
  1904.                                 if not table.find(chosen, opt) then
  1905.                                     table.insert(chosen, opt)
  1906.  
  1907.                                     multiSelectObj(option, optionPadding, true)
  1908.                                     value.TextColor3 = Color3.fromRGB(255, 255, 255)
  1909.                                     value.Text = table.concat(chosen, ", ")
  1910.  
  1911.                                     if flag then
  1912.                                         library.flags[flag] = chosen
  1913.                                     end
  1914.  
  1915.                                     callback(chosen)
  1916.                                 else
  1917.                                     table.remove(chosen, table.find(chosen, opt))
  1918.  
  1919.                                     multiSelectObj(option, optionPadding, false)
  1920.                                     value.TextColor3 =
  1921.                                         #chosen > 0 and Color3.fromRGB(255, 255, 255) or
  1922.                                         Color3.fromRGB(180, 180, 180)
  1923.                                     value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  1924.  
  1925.                                     if flag then
  1926.                                         library.flags[flag] = chosen
  1927.                                     end
  1928.  
  1929.                                     callback(chosen)
  1930.                                 end
  1931.                             end
  1932.                         end
  1933.                     )
  1934.                 end
  1935.  
  1936.                 local dropdownTypes = utility.table()
  1937.  
  1938.                 function dropdownTypes:Show()
  1939.                     dropdownHolder.Visible = true
  1940.                 end
  1941.  
  1942.                 function dropdownTypes:Hide()
  1943.                     dropdownHolder.Visible = false
  1944.                 end
  1945.  
  1946.                 function dropdownTypes:SetName(str)
  1947.                     title.Text = str
  1948.                 end
  1949.  
  1950.                 function dropdownTypes:Set(opt)
  1951.                     if opt then
  1952.                         if typeof(opt) == "string" then
  1953.                             if table.find(content, opt) then
  1954.                                 if not multiChoice then
  1955.                                     current = opt
  1956.                                     selectObj(
  1957.                                         contentHolder:FindFirstChild(opt),
  1958.                                         contentHolder:FindFirstChild(opt):FindFirstChildOfClass("UIPadding"),
  1959.                                         true
  1960.                                     )
  1961.                                     value.Text = opt
  1962.  
  1963.                                     if flag then
  1964.                                         library.flags[flag] = opt
  1965.                                     end
  1966.  
  1967.                                     callback(opt)
  1968.                                 else
  1969.                                     table.insert(chosen, opt)
  1970.  
  1971.                                     multiSelectObj(
  1972.                                         contentHolder:FindFirstChild(opt),
  1973.                                         contentHolder:FindFirstChild(opt):FindFirstChildOfClass("UIPadding"),
  1974.                                         true
  1975.                                     )
  1976.                                     value.TextColor3 = Color3.fromRGB(255, 255, 255)
  1977.                                     value.Text = table.concat(chosen, ", ")
  1978.  
  1979.                                     if flag then
  1980.                                         library.flags[flag] = chosen
  1981.                                     end
  1982.  
  1983.                                     callback(chosen)
  1984.                                 end
  1985.                             end
  1986.                         elseif multiChoice then
  1987.                             table.clear(chosen)
  1988.                             chosen = opt
  1989.  
  1990.                             for i, v in next, opt do
  1991.                                 if contentHolder:FindFirstChild(v) then
  1992.                                     multiSelectObj(
  1993.                                         contentHolder:FindFirstChild(v),
  1994.                                         contentHolder:FindFirstChild(v):FindFirstChildOfClass("UIPadding"),
  1995.                                         true
  1996.                                     )
  1997.  
  1998.                                     value.TextColor3 = Color3.fromRGB(255, 255, 255)
  1999.                                     value.Text = table.concat(chosen, ", ")
  2000.                                 end
  2001.                             end
  2002.                         end
  2003.                     else
  2004.                         if not multiChoice then
  2005.                             current = nil
  2006.  
  2007.                             for i, v in next, contentHolder:GetChildren() do
  2008.                                 if v:IsA("TextButton") then
  2009.                                     v:FindFirstChildOfClass("UIPadding").PaddingLeft = UDim.new(0, 6)
  2010.                                     v.Font = Enum.Font.Gotham
  2011.                                 end
  2012.                             end
  2013.  
  2014.                             value.Text = "NONE"
  2015.                             value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2016.  
  2017.                             if flag then
  2018.                                 library.flags[flag] = nil
  2019.                             end
  2020.  
  2021.                             callback(nil)
  2022.                         elseif multiChoice then
  2023.                             table.clear(chosen)
  2024.  
  2025.                             for i, v in next, contentHolder:GetChildren() do
  2026.                                 if v:IsA("TextButton") then
  2027.                                     v:FindFirstChildOfClass("UIPadding").PaddingLeft = UDim.new(0, 6)
  2028.                                     v.Font = Enum.Font.GothamSemiBold
  2029.                                 end
  2030.                             end
  2031.  
  2032.                             value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2033.                             value.Text = "NONE"
  2034.  
  2035.                             if flag then
  2036.                                 library.flags[flag] = chosen
  2037.                             end
  2038.  
  2039.                             callback(chosen)
  2040.                         end
  2041.                     end
  2042.                 end
  2043.  
  2044.                 function dropdownTypes:Add(opt)
  2045.                     table.insert(content, opt)
  2046.  
  2047.                     local option =
  2048.                         utility.create(
  2049.                         "TextButton",
  2050.                         {
  2051.                             Name = opt,
  2052.                             ZIndex = 11,
  2053.                             Size = UDim2.new(1, 0, 0, 14),
  2054.                             BackgroundTransparency = 1,
  2055.                             BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2056.                             FontSize = Enum.FontSize.Size12,
  2057.                             TextSize = 12,
  2058.                             TextColor3 = Color3.fromRGB(255, 255, 255),
  2059.                             Text = tostring(opt),
  2060.                             Font = current == opt and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  2061.                             TextXAlignment = Enum.TextXAlignment.Left,
  2062.                             Parent = contentHolder
  2063.                         }
  2064.                     )
  2065.  
  2066.                     local optionPadding =
  2067.                         utility.create(
  2068.                         "UIPadding",
  2069.                         {
  2070.                             PaddingLeft = current == opt and UDim.new(0, 10) or UDim.new(0, 6),
  2071.                             Parent = option
  2072.                         }
  2073.                     )
  2074.  
  2075.                     option.MouseButton1Click:Connect(
  2076.                         function()
  2077.                             if not multiChoice then
  2078.                                 if current ~= opt then
  2079.                                     current = opt
  2080.                                     selectObj(option, optionPadding, true)
  2081.                                     value.Text = opt
  2082.  
  2083.                                     if flag then
  2084.                                         library.flags[flag] = opt
  2085.                                     end
  2086.  
  2087.                                     callback(opt)
  2088.                                 else
  2089.                                     current = nil
  2090.                                     selectObj(option, optionPadding, false)
  2091.                                     value.Text = "NONE"
  2092.  
  2093.                                     if flag then
  2094.                                         library.flags[flag] = nil
  2095.                                     end
  2096.  
  2097.                                     callback(nil)
  2098.                                 end
  2099.                             else
  2100.                                 if not table.find(chosen, opt) then
  2101.                                     table.insert(chosen, opt)
  2102.  
  2103.                                     multiSelectObj(option, optionPadding, true)
  2104.                                     value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2105.                                     value.Text = table.concat(chosen, ", ")
  2106.  
  2107.                                     if flag then
  2108.                                         library.flags[flag] = chosen
  2109.                                     end
  2110.  
  2111.                                     callback(chosen)
  2112.                                 else
  2113.                                     table.remove(chosen, table.find(chosen, opt))
  2114.  
  2115.                                     multiSelectObj(option, optionPadding, false)
  2116.                                     value.TextColor3 =
  2117.                                         #chosen > 0 and Color3.fromRGB(255, 255, 255) or
  2118.                                         Color3.fromRGB(180, 180, 180)
  2119.                                     value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  2120.  
  2121.                                     if flag then
  2122.                                         library.flags[flag] = chosen
  2123.                                     end
  2124.  
  2125.                                     callback(chosen)
  2126.                                 end
  2127.                             end
  2128.                         end
  2129.                     )
  2130.                 end
  2131.  
  2132.                 function dropdownTypes:Remove(opt)
  2133.                     if table.find(content, opt) then
  2134.                         if not multiChoice then
  2135.                             if current == opt then
  2136.                                 dropdownTypes:Set(nil)
  2137.                             end
  2138.  
  2139.                             if contentHolder:FindFirstChild(opt) then
  2140.                                 contentHolder:FindFirstChild(opt):Destroy()
  2141.                             end
  2142.                         else
  2143.                             if table.find(chosen, opt) then
  2144.                                 table.remove(chosen, table.find(chosen, opt))
  2145.                                 value.TextColor3 =
  2146.                                     #chosen > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  2147.                                 value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  2148.                             end
  2149.  
  2150.                             if contentHolder:FindFirstChild(opt) then
  2151.                                 contentHolder:FindFirstChild(opt):Destroy()
  2152.                             end
  2153.                         end
  2154.                     end
  2155.                 end
  2156.  
  2157.                 function dropdownTypes:Refresh(tbl)
  2158.                     content = tbl
  2159.                     for _, opt in next, contentHolder:GetChildren() do
  2160.                         if opt:IsA("TextButton") then
  2161.                             opt:Destroy()
  2162.                         end
  2163.                     end
  2164.  
  2165.                     dropdownTypes:Set(nil)
  2166.  
  2167.                     for _, opt in next, content do
  2168.                         local option =
  2169.                             utility.create(
  2170.                             "TextButton",
  2171.                             {
  2172.                                 Name = opt,
  2173.                                 ZIndex = 11,
  2174.                                 Size = UDim2.new(1, 0, 0, 14),
  2175.                                 BackgroundTransparency = 1,
  2176.                                 BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2177.                                 FontSize = Enum.FontSize.Size12,
  2178.                                 TextSize = 12,
  2179.                                 TextColor3 = Color3.fromRGB(255, 255, 255),
  2180.                                 Text = tostring(opt),
  2181.                                 Font = current == opt and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  2182.                                 TextXAlignment = Enum.TextXAlignment.Left,
  2183.                                 Parent = contentHolder
  2184.                             }
  2185.                         )
  2186.  
  2187.                         local optionPadding =
  2188.                             utility.create(
  2189.                             "UIPadding",
  2190.                             {
  2191.                                 PaddingLeft = current == opt and UDim.new(0, 10) or UDim.new(0, 6),
  2192.                                 Parent = option
  2193.                             }
  2194.                         )
  2195.  
  2196.                         option.MouseButton1Click:Connect(
  2197.                             function()
  2198.                                 if not multiChoice then
  2199.                                     if current ~= opt then
  2200.                                         current = opt
  2201.                                         selectObj(option, optionPadding, true)
  2202.                                         value.Text = opt
  2203.  
  2204.                                         if flag then
  2205.                                             library.flags[flag] = opt
  2206.                                         end
  2207.  
  2208.                                         callback(opt)
  2209.                                     else
  2210.                                         current = nil
  2211.                                         selectObj(option, optionPadding, false)
  2212.                                         value.Text = "NONE"
  2213.  
  2214.                                         if flag then
  2215.                                             library.flags[flag] = nil
  2216.                                         end
  2217.  
  2218.                                         callback(nil)
  2219.                                     end
  2220.                                 else
  2221.                                     if not table.find(chosen, opt) then
  2222.                                         table.insert(chosen, opt)
  2223.  
  2224.                                         multiSelectObj(option, optionPadding, true)
  2225.                                         value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2226.                                         value.Text = table.concat(chosen, ", ")
  2227.  
  2228.                                         if flag then
  2229.                                             library.flags[flag] = chosen
  2230.                                         end
  2231.  
  2232.                                         callback(chosen)
  2233.                                     else
  2234.                                         table.remove(chosen, table.find(chosen, opt))
  2235.  
  2236.                                         multiSelectObj(option, optionPadding, false)
  2237.                                         value.TextColor3 =
  2238.                                             #chosen > 0 and Color3.fromRGB(255, 255, 255) or
  2239.                                             Color3.fromRGB(180, 180, 180)
  2240.                                         value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  2241.  
  2242.                                         if flag then
  2243.                                             library.flags[flag] = chosen
  2244.                                         end
  2245.  
  2246.                                         callback(chosen)
  2247.                                     end
  2248.                                 end
  2249.                             end
  2250.                         )
  2251.                     end
  2252.                 end
  2253.  
  2254.                 if flag then
  2255.                     if not multiChoice then
  2256.                         flags.dropdowns[flag] = function(opt)
  2257.                             dropdownTypes:Set(opt)
  2258.                         end
  2259.                     else
  2260.                         flags.multidropdowns[flag] = function(opt)
  2261.                             dropdownTypes:Set(opt)
  2262.                         end
  2263.                     end
  2264.                 end
  2265.  
  2266.                 return dropdownTypes
  2267.             end
  2268.  
  2269.             function sectionTypes:Keybind(opts)
  2270.                 local options = utility.table(opts)
  2271.                 local name = options.name or "Keybind"
  2272.                 local default = options.default
  2273.                 local blacklist = options.blacklist or {}
  2274.                 local flag = options.flag
  2275.                 local callback = options.callback or function()
  2276.                     end
  2277.  
  2278.                 if flag then
  2279.                     library.flags[flag] = default
  2280.                 end
  2281.  
  2282.                 local keys = {
  2283.                     [Enum.KeyCode.LeftShift] = "Left Shift",
  2284.                     [Enum.KeyCode.RightShift] = "Right Shft",
  2285.                     [Enum.KeyCode.LeftControl] = "Left Ctrl",
  2286.                     [Enum.KeyCode.RightControl] = "Right Ctrl",
  2287.                     [Enum.KeyCode.LeftAlt] = "Left Alt",
  2288.                     [Enum.KeyCode.RightAlt] = "Right Alt",
  2289.                     [Enum.KeyCode.CapsLock] = "CapsLock",
  2290.                     [Enum.KeyCode.One] = "1",
  2291.                     [Enum.KeyCode.Two] = "2",
  2292.                     [Enum.KeyCode.Three] = "3",
  2293.                     [Enum.KeyCode.Four] = "4",
  2294.                     [Enum.KeyCode.Five] = "5",
  2295.                     [Enum.KeyCode.Six] = "6",
  2296.                     [Enum.KeyCode.Seven] = "7",
  2297.                     [Enum.KeyCode.Eight] = "8",
  2298.                     [Enum.KeyCode.Nine] = "9",
  2299.                     [Enum.KeyCode.Zero] = "0",
  2300.                     [Enum.KeyCode.KeypadOne] = "Num 1",
  2301.                     [Enum.KeyCode.KeypadTwo] = "Num 2",
  2302.                     [Enum.KeyCode.KeypadThree] = "Num 3",
  2303.                     [Enum.KeyCode.KeypadFour] = "Num 4",
  2304.                     [Enum.KeyCode.KeypadFive] = "Num 5",
  2305.                     [Enum.KeyCode.KeypadSix] = "Num 6",
  2306.                     [Enum.KeyCode.KeypadSeven] = "Num 7",
  2307.                     [Enum.KeyCode.KeypadEight] = "Num 8",
  2308.                     [Enum.KeyCode.KeypadNine] = "Num 9",
  2309.                     [Enum.KeyCode.KeypadZero] = "Num 0",
  2310.                     [Enum.KeyCode.Minus] = "-",
  2311.                     [Enum.KeyCode.Equals] = "=",
  2312.                     [Enum.KeyCode.Tilde] = "~",
  2313.                     [Enum.KeyCode.LeftBracket] = "[",
  2314.                     [Enum.KeyCode.RightBracket] = "]",
  2315.                     [Enum.KeyCode.RightParenthesis] = ")",
  2316.                     [Enum.KeyCode.LeftParenthesis] = "(",
  2317.                     [Enum.KeyCode.Semicolon] = ";",
  2318.                     [Enum.KeyCode.Quote] = "'",
  2319.                     [Enum.KeyCode.BackSlash] = "\\",
  2320.                     [Enum.KeyCode.Comma] = ";",
  2321.                     [Enum.KeyCode.Period] = ".",
  2322.                     [Enum.KeyCode.Slash] = "/",
  2323.                     [Enum.KeyCode.Asterisk] = "*",
  2324.                     [Enum.KeyCode.Plus] = "+",
  2325.                     [Enum.KeyCode.Period] = ".",
  2326.                     [Enum.KeyCode.Backquote] = "`",
  2327.                     [Enum.UserInputType.MouseButton1] = "Mouse 1",
  2328.                     [Enum.UserInputType.MouseButton2] = "Mouse 2",
  2329.                     [Enum.UserInputType.MouseButton3] = "Mouse 3"
  2330.                 }
  2331.  
  2332.                 local keyChosen = default
  2333.  
  2334.                 local keybind =
  2335.                     utility.create(
  2336.                     "TextButton",
  2337.                     {
  2338.                         Size = UDim2.new(1, 0, 0, 16),
  2339.                         BackgroundTransparency = 1,
  2340.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2341.                         FontSize = Enum.FontSize.Size14,
  2342.                         TextSize = 14,
  2343.                         TextColor3 = Color3.fromRGB(0, 0, 0),
  2344.                         Font = Enum.Font.SourceSans,
  2345.                         Parent = sectionContent
  2346.                     }
  2347.                 )
  2348.  
  2349.                 local title =
  2350.                     utility.create(
  2351.                     "TextLabel",
  2352.                     {
  2353.                         ZIndex = 3,
  2354.                         Size = UDim2.new(0, 0, 1, 0),
  2355.                         BackgroundTransparency = 1,
  2356.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2357.                         FontSize = Enum.FontSize.Size14,
  2358.                         TextSize = 13,
  2359.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  2360.                         Text = name,
  2361.                         Font = Enum.Font.Gotham,
  2362.                         TextXAlignment = Enum.TextXAlignment.Left,
  2363.                         Parent = keybind
  2364.                     }
  2365.                 )
  2366.  
  2367.                 local value =
  2368.                     utility.create(
  2369.                     "TextLabel",
  2370.                     {
  2371.                         ZIndex = 3,
  2372.                         Size = UDim2.new(0, 0, 1, 0),
  2373.                         BackgroundTransparency = 1,
  2374.                         Position = UDim2.new(1, 0, 0, 0),
  2375.                         FontSize = Enum.FontSize.Size14,
  2376.                         TextSize = 13,
  2377.                         TextColor3 = Color3.fromRGB(180, 180, 180),
  2378.                         Text = default and (keys[default] or tostring(default):gsub("Enum.KeyCode.", "")) or "NONE",
  2379.                         Font = Enum.Font.Gotham,
  2380.                         TextXAlignment = Enum.TextXAlignment.Right,
  2381.                         Parent = keybind
  2382.                     }
  2383.                 )
  2384.  
  2385.                 keybind.MouseButton1Click:Connect(
  2386.                     function()
  2387.                         value.Text = "..."
  2388.                         value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2389.  
  2390.                         local binding
  2391.                         binding =
  2392.                             inputService.InputBegan:Connect(
  2393.                             function(input)
  2394.                                 local key = keys[input.KeyCode] or keys[input.UserInputType]
  2395.                                 value.Text = (keys[key] or tostring(input.KeyCode):gsub("Enum.KeyCode.", ""))
  2396.                                 value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2397.  
  2398.                                 if input.UserInputType == Enum.UserInputType.Keyboard then
  2399.                                     if not table.find(blacklist, input.KeyCode) then
  2400.                                         keyChosen = input.KeyCode
  2401.  
  2402.                                         if flag then
  2403.                                             library.flags[flag] = input.KeyCode
  2404.                                         end
  2405.  
  2406.                                         binding:Disconnect()
  2407.                                     else
  2408.                                         keyChosen = nil
  2409.                                         value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2410.                                         value.Text = "NONE"
  2411.  
  2412.                                         if flag then
  2413.                                             library.flags[flag] = nil
  2414.                                         end
  2415.  
  2416.                                         binding:Disconnect()
  2417.                                     end
  2418.                                 else
  2419.                                     if not table.find(blacklist, input.UserInputType) then
  2420.                                         keyChosen = input.UserInputType
  2421.  
  2422.                                         if flag then
  2423.                                             library.flags[flag] = input.UserInputType
  2424.                                         end
  2425.  
  2426.                                         binding:Disconnect()
  2427.                                     else
  2428.                                         keyChosen = nil
  2429.                                         value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2430.                                         value.Text = "NONE"
  2431.  
  2432.                                         if flag then
  2433.                                             library.flags[flag] = nil
  2434.                                         end
  2435.  
  2436.                                         binding:Disconnect()
  2437.                                     end
  2438.                                 end
  2439.                             end
  2440.                         )
  2441.                     end
  2442.                 )
  2443.  
  2444.                 inputService.InputBegan:Connect(
  2445.                     function(input)
  2446.                         if input.UserInputType == Enum.UserInputType.Keyboard then
  2447.                             if input.KeyCode == keyChosen then
  2448.                                 callback(keyChosen)
  2449.                             end
  2450.                         else
  2451.                             if input.UserInputType == keyChosen then
  2452.                                 callback(keyChosen)
  2453.                             end
  2454.                         end
  2455.                     end
  2456.                 )
  2457.  
  2458.                 local keybindTypes = utility.table()
  2459.  
  2460.                 function keybindTypes:Show()
  2461.                     keybind.Visible = true
  2462.                 end
  2463.  
  2464.                 function keybindTypes:Hide()
  2465.                     keybind.Visible = false
  2466.                 end
  2467.  
  2468.                 function keybindTypes:SetName(str)
  2469.                     title.Text = str
  2470.                 end
  2471.  
  2472.                 function keybindTypes:Set(newKey)
  2473.                     if typeof(newKey) == "EnumItem" then
  2474.                         if not table.find(blacklist, newKey) then
  2475.                             local key = keys[newKey]
  2476.                             value.Text = (keys[key] or tostring(newKey):gsub("Enum.KeyCode.", ""))
  2477.                             value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2478.  
  2479.                             keyChosen = newKey
  2480.  
  2481.                             if flag then
  2482.                                 library.flags[flag] = newKey
  2483.                             end
  2484.                         else
  2485.                             keyChosen = nil
  2486.                             value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2487.                             value.Text = "NONE"
  2488.  
  2489.                             if flag then
  2490.                                 library.flags[flag] = nil
  2491.                             end
  2492.                         end
  2493.                     end
  2494.                 end
  2495.  
  2496.                 if flag then
  2497.                     flags.keybinds[flag] = function(key)
  2498.                         keybindTypes:Set(key)
  2499.                     end
  2500.                 end
  2501.  
  2502.                 return keybindTypes
  2503.             end
  2504.  
  2505.             function sectionTypes:ToggleKeybind(opts)
  2506.                 local options = utility.table(opts)
  2507.                 local name = options.name or "Toggle Keybind"
  2508.                 local default = options.default
  2509.                 local blacklist = options.blacklist or {}
  2510.                 local toggleFlag = options.toggleFlag
  2511.                 local keybindFlag = options.keybindFlag
  2512.                 local toggleCallback = options.toggleCallback or function()
  2513.                     end
  2514.                 local keybindCallback = options.keybindCallback or function()
  2515.                     end
  2516.  
  2517.                 local keys = {
  2518.                     [Enum.KeyCode.LeftShift] = "Left Shift",
  2519.                     [Enum.KeyCode.RightShift] = "Right Shft",
  2520.                     [Enum.KeyCode.LeftControl] = "Left Ctrl",
  2521.                     [Enum.KeyCode.RightControl] = "Right Ctrl",
  2522.                     [Enum.KeyCode.LeftAlt] = "Left Alt",
  2523.                     [Enum.KeyCode.RightAlt] = "Right Alt",
  2524.                     [Enum.KeyCode.CapsLock] = "CapsLock",
  2525.                     [Enum.KeyCode.One] = "1",
  2526.                     [Enum.KeyCode.Two] = "2",
  2527.                     [Enum.KeyCode.Three] = "3",
  2528.                     [Enum.KeyCode.Four] = "4",
  2529.                     [Enum.KeyCode.Five] = "5",
  2530.                     [Enum.KeyCode.Six] = "6",
  2531.                     [Enum.KeyCode.Seven] = "7",
  2532.                     [Enum.KeyCode.Eight] = "8",
  2533.                     [Enum.KeyCode.Nine] = "9",
  2534.                     [Enum.KeyCode.Zero] = "0",
  2535.                     [Enum.KeyCode.KeypadOne] = "Num 1",
  2536.                     [Enum.KeyCode.KeypadTwo] = "Num 2",
  2537.                     [Enum.KeyCode.KeypadThree] = "Num 3",
  2538.                     [Enum.KeyCode.KeypadFour] = "Num 4",
  2539.                     [Enum.KeyCode.KeypadFive] = "Num 5",
  2540.                     [Enum.KeyCode.KeypadSix] = "Num 6",
  2541.                     [Enum.KeyCode.KeypadSeven] = "Num 7",
  2542.                     [Enum.KeyCode.KeypadEight] = "Num 8",
  2543.                     [Enum.KeyCode.KeypadNine] = "Num 9",
  2544.                     [Enum.KeyCode.KeypadZero] = "Num 0",
  2545.                     [Enum.KeyCode.Minus] = "-",
  2546.                     [Enum.KeyCode.Equals] = "=",
  2547.                     [Enum.KeyCode.Tilde] = "~",
  2548.                     [Enum.KeyCode.LeftBracket] = "[",
  2549.                     [Enum.KeyCode.RightBracket] = "]",
  2550.                     [Enum.KeyCode.RightParenthesis] = ")",
  2551.                     [Enum.KeyCode.LeftParenthesis] = "(",
  2552.                     [Enum.KeyCode.Semicolon] = ";",
  2553.                     [Enum.KeyCode.Quote] = "'",
  2554.                     [Enum.KeyCode.BackSlash] = "\\",
  2555.                     [Enum.KeyCode.Comma] = ";",
  2556.                     [Enum.KeyCode.Period] = ".",
  2557.                     [Enum.KeyCode.Slash] = "/",
  2558.                     [Enum.KeyCode.Asterisk] = "*",
  2559.                     [Enum.KeyCode.Plus] = "+",
  2560.                     [Enum.KeyCode.Period] = ".",
  2561.                     [Enum.KeyCode.Backquote] = "`",
  2562.                     [Enum.UserInputType.MouseButton1] = "Mouse 1",
  2563.                     [Enum.UserInputType.MouseButton2] = "Mouse 2",
  2564.                     [Enum.UserInputType.MouseButton3] = "Mouse 3"
  2565.                 }
  2566.  
  2567.                 local toggled = false
  2568.                 local keyChosen = default
  2569.  
  2570.                 if toggleFlag then
  2571.                     library.flags[toggleFlag] = toggled
  2572.                 end
  2573.  
  2574.                 if keybindFlag then
  2575.                     library.flags[keybindFlag] = default
  2576.                 end
  2577.  
  2578.                 local toggleKeybind =
  2579.                     utility.create(
  2580.                     "TextButton",
  2581.                     {
  2582.                         Size = UDim2.new(1, 0, 0, 16),
  2583.                         BackgroundTransparency = 1,
  2584.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2585.                         FontSize = Enum.FontSize.Size14,
  2586.                         TextSize = 14,
  2587.                         TextColor3 = Color3.fromRGB(0, 0, 0),
  2588.                         Font = Enum.Font.SourceSans,
  2589.                         Parent = sectionContent
  2590.                     }
  2591.                 )
  2592.  
  2593.                 local title =
  2594.                     utility.create(
  2595.                     "TextLabel",
  2596.                     {
  2597.                         ZIndex = 3,
  2598.                         Size = UDim2.new(0, 0, 1, 0),
  2599.                         BackgroundTransparency = 1,
  2600.                         Position = UDim2.new(0, 21, 0, 0),
  2601.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2602.                         FontSize = Enum.FontSize.Size14,
  2603.                         TextSize = 13,
  2604.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  2605.                         Text = name,
  2606.                         Font = Enum.Font.Gotham,
  2607.                         TextXAlignment = Enum.TextXAlignment.Left,
  2608.                         Parent = toggleKeybind
  2609.                     }
  2610.                 )
  2611.  
  2612.                 local icon =
  2613.                     utility.create(
  2614.                     "Frame",
  2615.                     {
  2616.                         ZIndex = 3,
  2617.                         Size = UDim2.new(0, 14, 1, -2),
  2618.                         BorderColor3 = Color3.fromRGB(37, 37, 37),
  2619.                         Position = UDim2.new(0, 0, 0, 1),
  2620.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2621.                         Parent = toggleKeybind
  2622.                     }
  2623.                 )
  2624.  
  2625.                 local iconGradient =
  2626.                     utility.create(
  2627.                     "UIGradient",
  2628.                     {
  2629.                         Rotation = 90,
  2630.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  2631.                         Parent = icon
  2632.                     }
  2633.                 )
  2634.  
  2635.                 local value =
  2636.                     utility.create(
  2637.                     "TextButton",
  2638.                     {
  2639.                         ZIndex = 3,
  2640.                         BackgroundTransparency = 1,
  2641.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2642.                         FontSize = Enum.FontSize.Size14,
  2643.                         TextSize = 13,
  2644.                         TextColor3 = Color3.fromRGB(180, 180, 180),
  2645.                         Text = default and (keys[default] or tostring(default):gsub("Enum.KeyCode.", "")) or "NONE",
  2646.                         Font = Enum.Font.Gotham,
  2647.                         TextXAlignment = Enum.TextXAlignment.Right,
  2648.                         Parent = toggleKeybind
  2649.                     }
  2650.                 )
  2651.  
  2652.                 value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2653.                 value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2654.  
  2655.                 local function toggleToggle()
  2656.                     toggled = not toggled
  2657.  
  2658.                     if toggled then
  2659.                         table.insert(coloredGradients, iconGradient)
  2660.                     else
  2661.                         table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  2662.                     end
  2663.  
  2664.                     local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  2665.                     local gradientColor
  2666.                     if toggled then
  2667.                         gradientColor =
  2668.                             ColorSequence.new {
  2669.                             ColorSequenceKeypoint.new(0, library.color),
  2670.                             ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  2671.                         }
  2672.                     else
  2673.                         gradientColor =
  2674.                             ColorSequence.new {
  2675.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  2676.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  2677.                         }
  2678.                     end
  2679.  
  2680.                     iconGradient.Color = gradientColor
  2681.                     title.TextColor3 = textColor
  2682.  
  2683.                     if toggleFlag then
  2684.                         library.flags[toggleFlag] = toggled
  2685.                     end
  2686.  
  2687.                     toggleCallback(toggled)
  2688.                 end
  2689.  
  2690.                 toggleKeybind.MouseButton1Click:Connect(toggleToggle)
  2691.  
  2692.                 value.MouseButton1Click:Connect(
  2693.                     function()
  2694.                         value.Text = "..."
  2695.                         value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2696.                         value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2697.                         value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2698.  
  2699.                         local binding
  2700.                         binding =
  2701.                             inputService.InputBegan:Connect(
  2702.                             function(input)
  2703.                                 local key = keys[input.KeyCode] or keys[input.UserInputType]
  2704.                                 value.Text = (keys[key] or tostring(input.KeyCode):gsub("Enum.KeyCode.", ""))
  2705.                                 value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2706.                                 value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2707.                                 value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2708.  
  2709.                                 if input.UserInputType == Enum.UserInputType.Keyboard then
  2710.                                     if not table.find(blacklist, input.KeyCode) then
  2711.                                         keyChosen = input.KeyCode
  2712.  
  2713.                                         if keybindFlag then
  2714.                                             library.flags[keybindFlag] = input.KeyCode
  2715.                                         end
  2716.  
  2717.                                         binding:Disconnect()
  2718.                                     else
  2719.                                         keyChosen = nil
  2720.                                         value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2721.                                         value.Text = "NONE"
  2722.                                         value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2723.                                         value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2724.  
  2725.                                         if keybindFlag then
  2726.                                             library.flags[keybindFlag] = nil
  2727.                                         end
  2728.  
  2729.                                         binding:Disconnect()
  2730.                                     end
  2731.                                 else
  2732.                                     if not table.find(blacklist, input.UserInputType) then
  2733.                                         keyChosen = input.UserInputType
  2734.  
  2735.                                         if keybindFlag then
  2736.                                             library.flags[keybindFlag] = input.UserInputType
  2737.                                         end
  2738.  
  2739.                                         binding:Disconnect()
  2740.                                     else
  2741.                                         keyChosen = nil
  2742.                                         value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2743.                                         value.Text = "NONE"
  2744.                                         value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2745.                                         value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2746.  
  2747.                                         if keybindFlag then
  2748.                                             library.flags[keybindFlag] = nil
  2749.                                         end
  2750.  
  2751.                                         binding:Disconnect()
  2752.                                     end
  2753.                                 end
  2754.                             end
  2755.                         )
  2756.                     end
  2757.                 )
  2758.  
  2759.                 inputService.InputBegan:Connect(
  2760.                     function(input)
  2761.                         if input.UserInputType == Enum.UserInputType.Keyboard then
  2762.                             if input.KeyCode == keyChosen then
  2763.                                 toggleToggle()
  2764.                                 keybindCallback(keyChosen)
  2765.                             end
  2766.                         else
  2767.                             if input.UserInputType == keyChosen then
  2768.                                 toggleToggle()
  2769.                                 keybindCallback(keyChosen)
  2770.                             end
  2771.                         end
  2772.                     end
  2773.                 )
  2774.  
  2775.                 local toggleKeybindTypes = utility.table()
  2776.  
  2777.                 function toggleKeybindTypes:Show()
  2778.                     keybind.Visible = true
  2779.                 end
  2780.  
  2781.                 function toggleKeybindTypes:Hide()
  2782.                     keybind.Visible = false
  2783.                 end
  2784.  
  2785.                 function toggleKeybindTypes:SetName(str)
  2786.                     title.Text = str
  2787.                 end
  2788.  
  2789.                 function toggleKeybindTypes:Toggle(bool)
  2790.                     if toggled ~= bool then
  2791.                         toggleToggle()
  2792.                     end
  2793.                 end
  2794.  
  2795.                 function toggleKeybindTypes:Set(newKey)
  2796.                     if typeof(newKey) == "EnumItem" then
  2797.                         if not table.find(blacklist, newKey) then
  2798.                             local key = keys[newKey]
  2799.                             value.Text = (keys[key] or tostring(newKey):gsub("Enum.KeyCode.", ""))
  2800.                             value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2801.                             value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2802.                             value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2803.  
  2804.                             keyChosen = newKey
  2805.  
  2806.                             if keybindFlag then
  2807.                                 library.flags[keybindFlag] = newKey
  2808.                             end
  2809.                         else
  2810.                             keyChosen = nil
  2811.                             value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2812.                             value.Text = "NONE"
  2813.  
  2814.                             if keybindFlag then
  2815.                                 library.flags[keybindFlag] = nil
  2816.                             end
  2817.                         end
  2818.                     end
  2819.                 end
  2820.  
  2821.                 if keybindFlag then
  2822.                     flags.keybinds[keybindFlag] = function(key)
  2823.                         toggleKeybindTypes:Set(key)
  2824.                     end
  2825.                 end
  2826.  
  2827.                 if toggleFlag then
  2828.                     flags.toggles[toggleFlag] = function(bool)
  2829.                         toggleKeybindTypes:Toggle(bool)
  2830.                     end
  2831.                 end
  2832.  
  2833.                 return toggleKeybindTypes
  2834.             end
  2835.  
  2836.             function sectionTypes:ColorPicker(opts)
  2837.                 local options = utility.table(opts)
  2838.                 local name = options.name or "Color Picker"
  2839.                 local default = options.default or Color3.fromRGB(255, 255, 255)
  2840.                 local flag = options.flag
  2841.                 local callback = options.callback or function()
  2842.                     end
  2843.  
  2844.                 local open = false
  2845.                 local hue, sat, val = default:ToHSV()
  2846.  
  2847.                 local slidingHue = false
  2848.                 local slidingSaturation = false
  2849.  
  2850.                 local hsv = Color3.fromHSV(hue, sat, val)
  2851.  
  2852.                 if flag then
  2853.                     library.flags[flag] = default
  2854.                 end
  2855.  
  2856.                 callback(default)
  2857.  
  2858.                 local colorPickerHolder =
  2859.                     utility.create(
  2860.                     "Frame",
  2861.                     {
  2862.                         Size = UDim2.new(1, 0, 0, 16),
  2863.                         Position = UDim2.new(0, 0, 0, 0),
  2864.                         BackgroundTransparency = 1,
  2865.                         Parent = sectionContent
  2866.                     }
  2867.                 )
  2868.  
  2869.                 local colorPicker =
  2870.                     utility.create(
  2871.                     "TextButton",
  2872.                     {
  2873.                         Size = UDim2.new(1, 0, 0, 16),
  2874.                         BackgroundTransparency = 1,
  2875.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2876.                         FontSize = Enum.FontSize.Size14,
  2877.                         TextSize = 14,
  2878.                         TextColor3 = Color3.fromRGB(0, 0, 0),
  2879.                         Font = Enum.Font.SourceSans,
  2880.                         Parent = colorPickerHolder
  2881.                     }
  2882.                 )
  2883.  
  2884.                 local title =
  2885.                     utility.create(
  2886.                     "TextLabel",
  2887.                     {
  2888.                         ZIndex = 3,
  2889.                         Size = UDim2.new(0, 0, 1, 0),
  2890.                         BackgroundTransparency = 1,
  2891.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2892.                         FontSize = Enum.FontSize.Size14,
  2893.                         TextSize = 13,
  2894.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  2895.                         Text = name,
  2896.                         Font = Enum.Font.Gotham,
  2897.                         TextXAlignment = Enum.TextXAlignment.Left,
  2898.                         Parent = colorPicker
  2899.                     }
  2900.                 )
  2901.  
  2902.                 local icon =
  2903.                     utility.create(
  2904.                     "Frame",
  2905.                     {
  2906.                         ZIndex = 3,
  2907.                         Size = UDim2.new(0, 22, 0, 14),
  2908.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  2909.                         Position = UDim2.new(1, -22, 0, 1),
  2910.                         BackgroundColor3 = default,
  2911.                         Parent = colorPicker
  2912.                     }
  2913.                 )
  2914.  
  2915.                 local iconGradient =
  2916.                     utility.create(
  2917.                     "UIGradient",
  2918.                     {
  2919.                         Rotation = 90,
  2920.                         Color = ColorSequence.new {
  2921.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
  2922.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(105, 105, 105))
  2923.                         },
  2924.                         Parent = icon
  2925.                     }
  2926.                 )
  2927.  
  2928.                 local picker =
  2929.                     utility.create(
  2930.                     "Frame",
  2931.                     {
  2932.                         ZIndex = 12,
  2933.                         Visible = false,
  2934.                         Size = UDim2.new(1, -8, 0, 183),
  2935.                         ClipsDescendants = true,
  2936.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  2937.                         Position = UDim2.new(0, 12, 1, 3),
  2938.                         BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  2939.                         Parent = colorPicker
  2940.                     }
  2941.                 )
  2942.  
  2943.                 local saturationFrame =
  2944.                     utility.create(
  2945.                     "ImageLabel",
  2946.                     {
  2947.                         ZIndex = 13,
  2948.                         Size = UDim2.new(1, -29, 0, 130),
  2949.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  2950.                         Position = UDim2.new(0, 5, 0, 5),
  2951.                         BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  2952.                         Image = "http://www.roblox.com/asset/?id=8630797271",
  2953.                         Parent = picker
  2954.                     }
  2955.                 )
  2956.  
  2957.                 local saturationPicker =
  2958.                     utility.create(
  2959.                     "Frame",
  2960.                     {
  2961.                         ZIndex = 15,
  2962.                         Size = UDim2.new(0, 4, 0, 4),
  2963.                         Position = UDim2.new(0, 5, 0, 5),
  2964.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2965.                         BorderColor3 = Color3.fromRGB(0, 0, 0),
  2966.                         BorderSizePixel = 1,
  2967.                         Parent = saturationFrame
  2968.                     }
  2969.                 )
  2970.  
  2971.                 local hueFrame =
  2972.                     utility.create(
  2973.                     "ImageLabel",
  2974.                     {
  2975.                         ZIndex = 13,
  2976.                         Size = UDim2.new(0, 14, 0, 130),
  2977.                         ClipsDescendants = true,
  2978.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  2979.                         BackgroundTransparency = 1,
  2980.                         Position = UDim2.new(1, -19, 0, 5),
  2981.                         BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  2982.                         ScaleType = Enum.ScaleType.Crop,
  2983.                         Image = "http://www.roblox.com/asset/?id=8630799159",
  2984.                         Parent = picker
  2985.                     }
  2986.                 )
  2987.  
  2988.                 local huePicker =
  2989.                     utility.create(
  2990.                     "Frame",
  2991.                     {
  2992.                         ZIndex = 15,
  2993.                         Size = UDim2.new(1, 0, 0, 2),
  2994.                         Position = UDim2.new(0, 0, 0, 10),
  2995.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2996.                         BorderColor3 = Color3.fromRGB(0, 0, 0),
  2997.                         BorderSizePixel = 1,
  2998.                         Parent = hueFrame
  2999.                     }
  3000.                 )
  3001.  
  3002.                 local rgb =
  3003.                     utility.create(
  3004.                     "TextBox",
  3005.                     {
  3006.                         ZIndex = 14,
  3007.                         Size = UDim2.new(1, -10, 0, 16),
  3008.                         BackgroundTransparency = 1,
  3009.                         Position = UDim2.new(0, 5, 1, -42),
  3010.                         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  3011.                         PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  3012.                         FontSize = Enum.FontSize.Size12,
  3013.                         TextSize = 12,
  3014.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  3015.                         Text = table.concat({utility.get_rgb(default)}, ", "),
  3016.                         ClearTextOnFocus = false,
  3017.                         Font = Enum.Font.Gotham,
  3018.                         PlaceholderText = "R,  G,  B",
  3019.                         Parent = picker
  3020.                     }
  3021.                 )
  3022.  
  3023.                 local bg =
  3024.                     utility.create(
  3025.                     "Frame",
  3026.                     {
  3027.                         ZIndex = 13,
  3028.                         Size = UDim2.new(1, 0, 1, 0),
  3029.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3030.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3031.                         Parent = rgb
  3032.                     }
  3033.                 )
  3034.  
  3035.                 utility.create(
  3036.                     "UIGradient",
  3037.                     {
  3038.                         Rotation = 90,
  3039.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3040.                         Parent = bg
  3041.                     }
  3042.                 )
  3043.  
  3044.                 local hex =
  3045.                     utility.create(
  3046.                     "TextBox",
  3047.                     {
  3048.                         ZIndex = 14,
  3049.                         Size = UDim2.new(1, -10, 0, 16),
  3050.                         BackgroundTransparency = 1,
  3051.                         Position = UDim2.new(0, 5, 1, -21),
  3052.                         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  3053.                         PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  3054.                         FontSize = Enum.FontSize.Size12,
  3055.                         TextSize = 12,
  3056.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  3057.                         Text = utility.rgb_to_hex(default),
  3058.                         ClearTextOnFocus = false,
  3059.                         Font = Enum.Font.Gotham,
  3060.                         PlaceholderText = utility.rgb_to_hex(default),
  3061.                         Parent = picker
  3062.                     }
  3063.                 )
  3064.  
  3065.                 local bg =
  3066.                     utility.create(
  3067.                     "Frame",
  3068.                     {
  3069.                         ZIndex = 13,
  3070.                         Size = UDim2.new(1, 0, 1, 0),
  3071.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3072.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3073.                         Parent = hex
  3074.                     }
  3075.                 )
  3076.  
  3077.                 utility.create(
  3078.                     "UIGradient",
  3079.                     {
  3080.                         Rotation = 90,
  3081.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3082.                         Parent = bg
  3083.                     }
  3084.                 )
  3085.  
  3086.                 local function openPicker()
  3087.                     open = not open
  3088.                     picker.Visible = open
  3089.                     colorPickerHolder.Size =
  3090.                         UDim2.new(1, 0, 0, open and colorPicker.AbsoluteSize.Y + picker.AbsoluteSize.Y + 3 or 16)
  3091.                 end
  3092.  
  3093.                 colorPicker.MouseButton1Click:connect(openPicker)
  3094.  
  3095.                 local function updateHue(input)
  3096.                     local sizeY =
  3097.                         1 -
  3098.                         math.clamp((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y, 0, 1)
  3099.                     local posY =
  3100.                         math.clamp(
  3101.                         ((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y) *
  3102.                             hueFrame.AbsoluteSize.Y,
  3103.                         0,
  3104.                         hueFrame.AbsoluteSize.Y - 2
  3105.                     )
  3106.                     huePicker.Position = UDim2.new(0, 0, 0, posY)
  3107.  
  3108.                     hue = sizeY
  3109.  
  3110.                     rgb.Text =
  3111.                         math.floor((hsv.r * 255) + 0.5) ..
  3112.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3113.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3114.  
  3115.                     hsv = Color3.fromHSV(hue, sat, val)
  3116.                     saturationFrame.BackgroundColor3 = hsv
  3117.                     icon.BackgroundColor3 = hsv
  3118.  
  3119.                     if flag then
  3120.                         library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3121.                     end
  3122.  
  3123.                     callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3124.                 end
  3125.  
  3126.                 hueFrame.InputBegan:Connect(
  3127.                     function(input)
  3128.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3129.                             slidingHue = true
  3130.                             updateHue(input)
  3131.                         end
  3132.                     end
  3133.                 )
  3134.  
  3135.                 hueFrame.InputEnded:Connect(
  3136.                     function(input)
  3137.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3138.                             slidingHue = false
  3139.                         end
  3140.                     end
  3141.                 )
  3142.  
  3143.                 inputService.InputChanged:Connect(
  3144.                     function(input)
  3145.                         if input.UserInputType == Enum.UserInputType.MouseMovement then
  3146.                             if slidingHue then
  3147.                                 updateHue(input)
  3148.                             end
  3149.                         end
  3150.                     end
  3151.                 )
  3152.  
  3153.                 local function updateSatVal(input)
  3154.                     local sizeX =
  3155.                         math.clamp(
  3156.                         (input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X,
  3157.                         0,
  3158.                         1
  3159.                     )
  3160.                     local sizeY =
  3161.                         1 -
  3162.                         math.clamp(
  3163.                             (input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y,
  3164.                             0,
  3165.                             1
  3166.                         )
  3167.                     local posY =
  3168.                         math.clamp(
  3169.                         ((input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y) *
  3170.                             saturationFrame.AbsoluteSize.Y,
  3171.                         0,
  3172.                         saturationFrame.AbsoluteSize.Y - 4
  3173.                     )
  3174.                     local posX =
  3175.                         math.clamp(
  3176.                         ((input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X) *
  3177.                             saturationFrame.AbsoluteSize.X,
  3178.                         0,
  3179.                         saturationFrame.AbsoluteSize.X - 4
  3180.                     )
  3181.  
  3182.                     saturationPicker.Position = UDim2.new(0, posX, 0, posY)
  3183.  
  3184.                     sat = sizeX
  3185.                     val = sizeY
  3186.  
  3187.                     hsv = Color3.fromHSV(hue, sat, val)
  3188.  
  3189.                     rgb.Text =
  3190.                         math.floor((hsv.r * 255) + 0.5) ..
  3191.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3192.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3193.  
  3194.                     saturationFrame.BackgroundColor3 = hsv
  3195.                     icon.BackgroundColor3 = hsv
  3196.  
  3197.                     if flag then
  3198.                         library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3199.                     end
  3200.  
  3201.                     callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3202.                 end
  3203.  
  3204.                 saturationFrame.InputBegan:Connect(
  3205.                     function(input)
  3206.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3207.                             slidingSaturation = true
  3208.                             updateSatVal(input)
  3209.                         end
  3210.                     end
  3211.                 )
  3212.  
  3213.                 saturationFrame.InputEnded:Connect(
  3214.                     function(input)
  3215.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3216.                             slidingSaturation = false
  3217.                         end
  3218.                     end
  3219.                 )
  3220.  
  3221.                 inputService.InputChanged:Connect(
  3222.                     function(input)
  3223.                         if input.UserInputType == Enum.UserInputType.MouseMovement then
  3224.                             if slidingSaturation then
  3225.                                 updateSatVal(input)
  3226.                             end
  3227.                         end
  3228.                     end
  3229.                 )
  3230.  
  3231.                 local colorPickerTypes = utility.table()
  3232.  
  3233.                 function colorPickerTypes:Show()
  3234.                     colorPickerHolder.Visible = true
  3235.                 end
  3236.  
  3237.                 function colorPickerTypes:Hide()
  3238.                     colorPickerHolder.Visible = false
  3239.                 end
  3240.  
  3241.                 function colorPickerTypes:SetName(str)
  3242.                     title.Text = str
  3243.                 end
  3244.  
  3245.                 function colorPickerTypes:SetRGB(color)
  3246.                     hue, sat, val = color:ToHSV()
  3247.                     hsv = Color3.fromHSV(hue, sat, val)
  3248.  
  3249.                     saturationFrame.BackgroundColor3 = hsv
  3250.                     icon.BackgroundColor3 = hsv
  3251.                     saturationPicker.Position =
  3252.                         UDim2.new(
  3253.                         0,
  3254.                         (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)),
  3255.                         0,
  3256.                         (math.clamp(
  3257.                             (1 - val) * saturationFrame.AbsoluteSize.Y,
  3258.                             0,
  3259.                             saturationFrame.AbsoluteSize.Y - 4
  3260.                         ))
  3261.                     )
  3262.                     huePicker.Position =
  3263.                         UDim2.new(
  3264.                         0,
  3265.                         0,
  3266.                         0,
  3267.                         math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4)
  3268.                     )
  3269.  
  3270.                     rgb.Text =
  3271.                         math.floor((hsv.r * 255) + 0.5) ..
  3272.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3273.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3274.  
  3275.                     if flag then
  3276.                         library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3277.                     end
  3278.  
  3279.                     callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3280.                 end
  3281.  
  3282.                 function colorPickerTypes:SetHex(hexValue)
  3283.                     color = utility.hex_to_rgb(hexValue)
  3284.  
  3285.                     hue, sat, val = color:ToHSV()
  3286.                     hsv = Color3.fromHSV(hue, sat, val)
  3287.  
  3288.                     saturationFrame.BackgroundColor3 = hsv
  3289.                     icon.BackgroundColor3 = hsv
  3290.                     saturationPicker.Position =
  3291.                         UDim2.new(
  3292.                         0,
  3293.                         (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)),
  3294.                         0,
  3295.                         (math.clamp(
  3296.                             (1 - val) * saturationFrame.AbsoluteSize.Y,
  3297.                             0,
  3298.                             saturationFrame.AbsoluteSize.Y - 4
  3299.                         ))
  3300.                     )
  3301.                     huePicker.Position =
  3302.                         UDim2.new(
  3303.                         0,
  3304.                         0,
  3305.                         0,
  3306.                         math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4)
  3307.                     )
  3308.  
  3309.                     rgb.Text =
  3310.                         math.floor((hsv.r * 255) + 0.5) ..
  3311.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3312.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3313.  
  3314.                     if flag then
  3315.                         library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3316.                     end
  3317.  
  3318.                     callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3319.                 end
  3320.  
  3321.                 rgb.FocusLost:Connect(
  3322.                     function()
  3323.                         local _, amount = rgb.Text:gsub(", ", "")
  3324.                         if amount == 2 then
  3325.                             local values = rgb.Text:split(", ")
  3326.                             local r, g, b =
  3327.                                 math.clamp(values[1], 0, 255),
  3328.                                 math.clamp(values[2], 0, 255),
  3329.                                 math.clamp(values[3], 0, 255)
  3330.                             colorPickerTypes:SetRGB(Color3.fromRGB(r, g, b))
  3331.                         else
  3332.                             rgb.Text =
  3333.                                 math.floor((hsv.r * 255) + 0.5) ..
  3334.                                 ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3335.                         end
  3336.                     end
  3337.                 )
  3338.  
  3339.                 hex.FocusLost:Connect(
  3340.                     function()
  3341.                         if hex.Text:find("#") and hex.Text:len() == 7 then
  3342.                             colorPickerTypes:SetHex(hex.Text)
  3343.                         else
  3344.                             hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3345.                         end
  3346.                     end
  3347.                 )
  3348.  
  3349.                 hex:GetPropertyChangedSignal("Text"):Connect(
  3350.                     function()
  3351.                         if hex.Text == "" then
  3352.                             hex.Text = "#"
  3353.                         end
  3354.                     end
  3355.                 )
  3356.  
  3357.                 if flag then
  3358.                     flags.colorpickers[flag] = function(color)
  3359.                         colorPickerTypes:SetRGB(color)
  3360.                     end
  3361.                 end
  3362.  
  3363.                 return colorPickerTypes
  3364.             end
  3365.  
  3366.             function sectionTypes:ToggleColorPicker(opts)
  3367.                 local options = utility.table(opts)
  3368.                 local name = options.name or "Toggle Color Picker"
  3369.                 local default = options.default or Color3.fromRGB(255, 255, 255)
  3370.                 local toggleFlag = options.toggleFlag
  3371.                 local colorPickerFlag = options.colorPickerFlag
  3372.                 local toggleCallback = options.toggleCallback or function()
  3373.                     end
  3374.                 local colorPickerCallback = options.colorPickerCallback or function()
  3375.                     end
  3376.  
  3377.                 local open = false
  3378.                 local toggled = false
  3379.                 local hue, sat, val = default:ToHSV()
  3380.  
  3381.                 local slidingHue = false
  3382.                 local slidingSaturation = false
  3383.  
  3384.                 local hsv = Color3.fromHSV(hue, sat, val)
  3385.  
  3386.                 if colorPickerFlag then
  3387.                     library.flags[colorPickerFlag] = default
  3388.                 end
  3389.  
  3390.                 colorPickerCallback(default)
  3391.  
  3392.                 if toggleFlag then
  3393.                     library.flags[toggleFlag] = toggled
  3394.                 end
  3395.  
  3396.                 toggleCallback(false)
  3397.  
  3398.                 local toggleColorPickerHolder =
  3399.                     utility.create(
  3400.                     "Frame",
  3401.                     {
  3402.                         Size = UDim2.new(1, 0, 0, 16),
  3403.                         Position = UDim2.new(0, 0, 0, 0),
  3404.                         BackgroundTransparency = 1,
  3405.                         Parent = sectionContent
  3406.                     }
  3407.                 )
  3408.  
  3409.                 local colorPicker =
  3410.                     utility.create(
  3411.                     "TextButton",
  3412.                     {
  3413.                         Size = UDim2.new(1, 0, 0, 16),
  3414.                         BackgroundTransparency = 1,
  3415.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3416.                         FontSize = Enum.FontSize.Size14,
  3417.                         TextSize = 14,
  3418.                         TextColor3 = Color3.fromRGB(0, 0, 0),
  3419.                         Font = Enum.Font.SourceSans,
  3420.                         Parent = toggleColorPickerHolder
  3421.                     }
  3422.                 )
  3423.  
  3424.                 local icon =
  3425.                     utility.create(
  3426.                     "Frame",
  3427.                     {
  3428.                         ZIndex = 3,
  3429.                         Size = UDim2.new(0, 14, 1, -2),
  3430.                         BorderColor3 = Color3.fromRGB(37, 37, 37),
  3431.                         Position = UDim2.new(0, 0, 0, 1),
  3432.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3433.                         Parent = colorPicker
  3434.                     }
  3435.                 )
  3436.  
  3437.                 local iconGradient =
  3438.                     utility.create(
  3439.                     "UIGradient",
  3440.                     {
  3441.                         Rotation = 90,
  3442.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3443.                         Parent = icon
  3444.                     }
  3445.                 )
  3446.  
  3447.                 local colorPickerIcon =
  3448.                     utility.create(
  3449.                     "TextButton",
  3450.                     {
  3451.                         ZIndex = 3,
  3452.                         Text = "",
  3453.                         Size = UDim2.new(0, 22, 0, 14),
  3454.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3455.                         Position = UDim2.new(1, -22, 0, 1),
  3456.                         BackgroundColor3 = default,
  3457.                         Parent = colorPicker
  3458.                     }
  3459.                 )
  3460.  
  3461.                 local colorPickerIconGradient =
  3462.                     utility.create(
  3463.                     "UIGradient",
  3464.                     {
  3465.                         Rotation = 90,
  3466.                         Color = ColorSequence.new {
  3467.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
  3468.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(105, 105, 105))
  3469.                         },
  3470.                         Parent = colorPickerIcon
  3471.                     }
  3472.                 )
  3473.  
  3474.                 local title =
  3475.                     utility.create(
  3476.                     "TextLabel",
  3477.                     {
  3478.                         ZIndex = 3,
  3479.                         Size = UDim2.new(0, 0, 1, 0),
  3480.                         BackgroundTransparency = 1,
  3481.                         Position = UDim2.new(1, 7, 0, 0),
  3482.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3483.                         FontSize = Enum.FontSize.Size14,
  3484.                         TextSize = 13,
  3485.                         TextColor3 = Color3.fromRGB(180, 180, 180),
  3486.                         Text = name,
  3487.                         Font = Enum.Font.Gotham,
  3488.                         TextXAlignment = Enum.TextXAlignment.Left,
  3489.                         Parent = icon
  3490.                     }
  3491.                 )
  3492.  
  3493.                 local picker =
  3494.                     utility.create(
  3495.                     "Frame",
  3496.                     {
  3497.                         ZIndex = 12,
  3498.                         Visible = false,
  3499.                         Size = UDim2.new(1, -8, 0, 183),
  3500.                         ClipsDescendants = true,
  3501.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3502.                         Position = UDim2.new(0, 12, 1, 3),
  3503.                         BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  3504.                         Parent = colorPicker
  3505.                     }
  3506.                 )
  3507.  
  3508.                 local saturationFrame =
  3509.                     utility.create(
  3510.                     "ImageLabel",
  3511.                     {
  3512.                         ZIndex = 13,
  3513.                         Size = UDim2.new(1, -29, 0, 130),
  3514.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3515.                         Position = UDim2.new(0, 5, 0, 5),
  3516.                         BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  3517.                         Image = "http://www.roblox.com/asset/?id=8630797271",
  3518.                         Parent = picker
  3519.                     }
  3520.                 )
  3521.  
  3522.                 local saturationPicker =
  3523.                     utility.create(
  3524.                     "Frame",
  3525.                     {
  3526.                         ZIndex = 15,
  3527.                         Size = UDim2.new(0, 4, 0, 4),
  3528.                         Position = UDim2.new(0, 5, 0, 5),
  3529.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3530.                         BorderColor3 = Color3.fromRGB(0, 0, 0),
  3531.                         BorderSizePixel = 1,
  3532.                         Parent = saturationFrame
  3533.                     }
  3534.                 )
  3535.  
  3536.                 local hueFrame =
  3537.                     utility.create(
  3538.                     "ImageLabel",
  3539.                     {
  3540.                         ZIndex = 13,
  3541.                         Size = UDim2.new(0, 14, 0, 130),
  3542.                         ClipsDescendants = true,
  3543.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3544.                         BackgroundTransparency = 1,
  3545.                         Position = UDim2.new(1, -19, 0, 5),
  3546.                         BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  3547.                         ScaleType = Enum.ScaleType.Crop,
  3548.                         Image = "http://www.roblox.com/asset/?id=8630799159",
  3549.                         Parent = picker
  3550.                     }
  3551.                 )
  3552.  
  3553.                 local huePicker =
  3554.                     utility.create(
  3555.                     "Frame",
  3556.                     {
  3557.                         ZIndex = 15,
  3558.                         Size = UDim2.new(1, 0, 0, 2),
  3559.                         Position = UDim2.new(0, 0, 0, 10),
  3560.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3561.                         BorderColor3 = Color3.fromRGB(0, 0, 0),
  3562.                         BorderSizePixel = 1,
  3563.                         Parent = hueFrame
  3564.                     }
  3565.                 )
  3566.  
  3567.                 local rgb =
  3568.                     utility.create(
  3569.                     "TextBox",
  3570.                     {
  3571.                         ZIndex = 14,
  3572.                         Size = UDim2.new(1, -10, 0, 16),
  3573.                         BackgroundTransparency = 1,
  3574.                         Position = UDim2.new(0, 5, 1, -42),
  3575.                         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  3576.                         PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  3577.                         FontSize = Enum.FontSize.Size12,
  3578.                         TextSize = 12,
  3579.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  3580.                         Text = table.concat({utility.get_rgb(default)}, ", "),
  3581.                         ClearTextOnFocus = false,
  3582.                         Font = Enum.Font.Gotham,
  3583.                         PlaceholderText = "R,  G,  B",
  3584.                         Parent = picker
  3585.                     }
  3586.                 )
  3587.  
  3588.                 local bg =
  3589.                     utility.create(
  3590.                     "Frame",
  3591.                     {
  3592.                         ZIndex = 13,
  3593.                         Size = UDim2.new(1, 0, 1, 0),
  3594.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3595.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3596.                         Parent = rgb
  3597.                     }
  3598.                 )
  3599.  
  3600.                 utility.create(
  3601.                     "UIGradient",
  3602.                     {
  3603.                         Rotation = 90,
  3604.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3605.                         Parent = bg
  3606.                     }
  3607.                 )
  3608.  
  3609.                 local hex =
  3610.                     utility.create(
  3611.                     "TextBox",
  3612.                     {
  3613.                         ZIndex = 14,
  3614.                         Size = UDim2.new(1, -10, 0, 16),
  3615.                         BackgroundTransparency = 1,
  3616.                         Position = UDim2.new(0, 5, 1, -21),
  3617.                         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  3618.                         PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  3619.                         FontSize = Enum.FontSize.Size12,
  3620.                         TextSize = 12,
  3621.                         TextColor3 = Color3.fromRGB(255, 255, 255),
  3622.                         Text = utility.rgb_to_hex(default),
  3623.                         ClearTextOnFocus = false,
  3624.                         Font = Enum.Font.Gotham,
  3625.                         PlaceholderText = utility.rgb_to_hex(default),
  3626.                         Parent = picker
  3627.                     }
  3628.                 )
  3629.  
  3630.                 local bg =
  3631.                     utility.create(
  3632.                     "Frame",
  3633.                     {
  3634.                         ZIndex = 13,
  3635.                         Size = UDim2.new(1, 0, 1, 0),
  3636.                         BorderColor3 = Color3.fromRGB(22, 22, 22),
  3637.                         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3638.                         Parent = hex
  3639.                     }
  3640.                 )
  3641.  
  3642.                 utility.create(
  3643.                     "UIGradient",
  3644.                     {
  3645.                         Rotation = 90,
  3646.                         Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3647.                         Parent = bg
  3648.                     }
  3649.                 )
  3650.  
  3651.                 local function toggleToggle()
  3652.                     toggled = not toggled
  3653.  
  3654.                     if toggled then
  3655.                         table.insert(coloredGradients, iconGradient)
  3656.                     else
  3657.                         table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  3658.                     end
  3659.  
  3660.                     local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  3661.                     local gradientColor
  3662.                     if toggled then
  3663.                         gradientColor =
  3664.                             ColorSequence.new {
  3665.                             ColorSequenceKeypoint.new(0, library.color),
  3666.                             ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  3667.                         }
  3668.                     else
  3669.                         gradientColor =
  3670.                             ColorSequence.new {
  3671.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  3672.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  3673.                         }
  3674.                     end
  3675.  
  3676.                     iconGradient.Color = gradientColor
  3677.                     title.TextColor3 = textColor
  3678.  
  3679.                     if toggleFlag then
  3680.                         library.flags[toggleFlag] = toggled
  3681.                     end
  3682.  
  3683.                     toggleCallback(toggled)
  3684.                 end
  3685.  
  3686.                 colorPicker.MouseButton1Click:Connect(toggleToggle)
  3687.  
  3688.                 local function openPicker()
  3689.                     open = not open
  3690.                     picker.Visible = open
  3691.                     toggleColorPickerHolder.Size =
  3692.                         UDim2.new(1, 0, 0, open and colorPicker.AbsoluteSize.Y + picker.AbsoluteSize.Y + 3 or 16)
  3693.                 end
  3694.  
  3695.                 colorPickerIcon.MouseButton1Click:connect(openPicker)
  3696.  
  3697.                 local function updateHue(input)
  3698.                     local sizeY =
  3699.                         1 -
  3700.                         math.clamp((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y, 0, 1)
  3701.                     local posY =
  3702.                         math.clamp(
  3703.                         ((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y) *
  3704.                             hueFrame.AbsoluteSize.Y,
  3705.                         0,
  3706.                         hueFrame.AbsoluteSize.Y - 2
  3707.                     )
  3708.                     huePicker.Position = UDim2.new(0, 0, 0, posY)
  3709.  
  3710.                     hue = sizeY
  3711.  
  3712.                     rgb.Text =
  3713.                         math.floor((hsv.r * 255) + 0.5) ..
  3714.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3715.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3716.  
  3717.                     hsv = Color3.fromHSV(hue, sat, val)
  3718.                     saturationFrame.BackgroundColor3 = hsv
  3719.                     colorPickerIcon.BackgroundColor3 = hsv
  3720.  
  3721.                     if colorPickerFlag then
  3722.                         library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3723.                     end
  3724.  
  3725.                     colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3726.                 end
  3727.  
  3728.                 hueFrame.InputBegan:Connect(
  3729.                     function(input)
  3730.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3731.                             slidingHue = true
  3732.                             updateHue(input)
  3733.                         end
  3734.                     end
  3735.                 )
  3736.  
  3737.                 hueFrame.InputEnded:Connect(
  3738.                     function(input)
  3739.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3740.                             slidingHue = false
  3741.                         end
  3742.                     end
  3743.                 )
  3744.  
  3745.                 inputService.InputChanged:Connect(
  3746.                     function(input)
  3747.                         if input.UserInputType == Enum.UserInputType.MouseMovement then
  3748.                             if slidingHue then
  3749.                                 updateHue(input)
  3750.                             end
  3751.                         end
  3752.                     end
  3753.                 )
  3754.  
  3755.                 local function updateSatVal(input)
  3756.                     local sizeX =
  3757.                         math.clamp(
  3758.                         (input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X,
  3759.                         0,
  3760.                         1
  3761.                     )
  3762.                     local sizeY =
  3763.                         1 -
  3764.                         math.clamp(
  3765.                             (input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y,
  3766.                             0,
  3767.                             1
  3768.                         )
  3769.                     local posY =
  3770.                         math.clamp(
  3771.                         ((input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y) *
  3772.                             saturationFrame.AbsoluteSize.Y,
  3773.                         0,
  3774.                         saturationFrame.AbsoluteSize.Y - 4
  3775.                     )
  3776.                     local posX =
  3777.                         math.clamp(
  3778.                         ((input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X) *
  3779.                             saturationFrame.AbsoluteSize.X,
  3780.                         0,
  3781.                         saturationFrame.AbsoluteSize.X - 4
  3782.                     )
  3783.  
  3784.                     saturationPicker.Position = UDim2.new(0, posX, 0, posY)
  3785.  
  3786.                     sat = sizeX
  3787.                     val = sizeY
  3788.  
  3789.                     hsv = Color3.fromHSV(hue, sat, val)
  3790.  
  3791.                     rgb.Text =
  3792.                         math.floor((hsv.r * 255) + 0.5) ..
  3793.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3794.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3795.  
  3796.                     saturationFrame.BackgroundColor3 = hsv
  3797.                     colorPickerIcon.BackgroundColor3 = hsv
  3798.  
  3799.                     if colorPickerFlag then
  3800.                         library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3801.                     end
  3802.  
  3803.                     colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3804.                 end
  3805.  
  3806.                 saturationFrame.InputBegan:Connect(
  3807.                     function(input)
  3808.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3809.                             slidingSaturation = true
  3810.                             updateSatVal(input)
  3811.                         end
  3812.                     end
  3813.                 )
  3814.  
  3815.                 saturationFrame.InputEnded:Connect(
  3816.                     function(input)
  3817.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3818.                             slidingSaturation = false
  3819.                         end
  3820.                     end
  3821.                 )
  3822.  
  3823.                 inputService.InputChanged:Connect(
  3824.                     function(input)
  3825.                         if input.UserInputType == Enum.UserInputType.MouseMovement then
  3826.                             if slidingSaturation then
  3827.                                 updateSatVal(input)
  3828.                             end
  3829.                         end
  3830.                     end
  3831.                 )
  3832.  
  3833.                 local toggleColorPickerTypes = utility.table()
  3834.  
  3835.                 function toggleColorPickerTypes:Show()
  3836.                     toggleColorPickerHolder.Visible = true
  3837.                 end
  3838.  
  3839.                 function toggleColorPickerTypes:Hide()
  3840.                     toggleColorPickerHolder.Visible = false
  3841.                 end
  3842.  
  3843.                 function toggleColorPickerTypes:SetName(str)
  3844.                     title.Text = str
  3845.                 end
  3846.  
  3847.                 function toggleColorPickerTypes:Toggle(bool)
  3848.                     if toggled ~= bool then
  3849.                         toggleToggle()
  3850.                     end
  3851.                 end
  3852.  
  3853.                 function toggleColorPickerTypes:SetRGB(color)
  3854.                     hue, sat, val = color:ToHSV()
  3855.                     hsv = Color3.fromHSV(hue, sat, val)
  3856.  
  3857.                     saturationFrame.BackgroundColor3 = hsv
  3858.                     colorPickerIcon.BackgroundColor3 = hsv
  3859.                     saturationPicker.Position =
  3860.                         UDim2.new(
  3861.                         0,
  3862.                         (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)),
  3863.                         0,
  3864.                         (math.clamp(
  3865.                             (1 - val) * saturationFrame.AbsoluteSize.Y,
  3866.                             0,
  3867.                             saturationFrame.AbsoluteSize.Y - 4
  3868.                         ))
  3869.                     )
  3870.                     huePicker.Position =
  3871.                         UDim2.new(
  3872.                         0,
  3873.                         0,
  3874.                         0,
  3875.                         math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4)
  3876.                     )
  3877.  
  3878.                     rgb.Text =
  3879.                         math.floor((hsv.r * 255) + 0.5) ..
  3880.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3881.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3882.  
  3883.                     if colorPickerFlag then
  3884.                         library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3885.                     end
  3886.  
  3887.                     colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3888.                 end
  3889.  
  3890.                 function toggleColorPickerTypes:SetHex(hexValue)
  3891.                     color = utility.hex_to_rgb(hexValue)
  3892.  
  3893.                     hue, sat, val = color:ToHSV()
  3894.                     hsv = Color3.fromHSV(hue, sat, val)
  3895.  
  3896.                     saturationFrame.BackgroundColor3 = hsv
  3897.                     colorPickerIcon.BackgroundColor3 = hsv
  3898.                     saturationPicker.Position =
  3899.                         UDim2.new(
  3900.                         0,
  3901.                         (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)),
  3902.                         0,
  3903.                         (math.clamp(
  3904.                             (1 - val) * saturationFrame.AbsoluteSize.Y,
  3905.                             0,
  3906.                             saturationFrame.AbsoluteSize.Y - 4
  3907.                         ))
  3908.                     )
  3909.                     huePicker.Position =
  3910.                         UDim2.new(
  3911.                         0,
  3912.                         0,
  3913.                         0,
  3914.                         math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4)
  3915.                     )
  3916.  
  3917.                     rgb.Text =
  3918.                         math.floor((hsv.r * 255) + 0.5) ..
  3919.                         ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3920.                     hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3921.  
  3922.                     if colorPickerFlag then
  3923.                         library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3924.                     end
  3925.  
  3926.                     colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3927.                 end
  3928.  
  3929.                 rgb.FocusLost:Connect(
  3930.                     function()
  3931.                         local _, amount = rgb.Text:gsub(", ", "")
  3932.                         if amount == 2 then
  3933.                             local values = rgb.Text:split(", ")
  3934.                             local r, g, b =
  3935.                                 math.clamp(values[1], 0, 255),
  3936.                                 math.clamp(values[2], 0, 255),
  3937.                                 math.clamp(values[3], 0, 255)
  3938.                             toggleColorPickerTypes:SetRGB(Color3.fromRGB(r, g, b))
  3939.                         else
  3940.                             rgb.Text =
  3941.                                 math.floor((hsv.r * 255) + 0.5) ..
  3942.                                 ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3943.                         end
  3944.                     end
  3945.                 )
  3946.  
  3947.                 hex.FocusLost:Connect(
  3948.                     function()
  3949.                         if hex.Text:find("#") and hex.Text:len() == 7 then
  3950.                             toggleColorPickerTypes:SetHex(hex.Text)
  3951.                         else
  3952.                             hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3953.                         end
  3954.                     end
  3955.                 )
  3956.  
  3957.                 hex:GetPropertyChangedSignal("Text"):Connect(
  3958.                     function()
  3959.                         if hex.Text == "" then
  3960.                             hex.Text = "#"
  3961.                         end
  3962.                     end
  3963.                 )
  3964.  
  3965.                 if colorPickerFlag then
  3966.                     flags.colorpickers[colorPickerFlag] = function(color)
  3967.                         toggleColorPickerTypes:SetRGB(color)
  3968.                     end
  3969.                 end
  3970.  
  3971.                 if toggleFlag then
  3972.                     flags.toggles[toggleFlag] = function(bool)
  3973.                         toggleColorPickerTypes:Toggle(bool)
  3974.                     end
  3975.                 end
  3976.  
  3977.                 return toggleColorPickerTypes
  3978.             end
  3979.  
  3980.             return sectionTypes
  3981.         end
  3982.  
  3983.         return tabTypes
  3984.     end
  3985.  
  3986.     return windowTypes
  3987. end
  3988.  
  3989. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement