Advertisement
DankGreenMoney

v1

Jul 11th, 2022 (edited)
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 102.42 KB | None | 0 0
  1. -- Modified support for Krnl and others
  2.  
  3. --LIBRARY START
  4. --Services
  5. getgenv().runService = game:GetService"RunService"
  6. getgenv().textService = game:GetService"TextService"
  7. getgenv().inputService = game:GetService"UserInputService"
  8. getgenv().tweenService = game:GetService"TweenService"
  9.  
  10. if getgenv().library then
  11.     getgenv().library:Unload()
  12. end
  13.  
  14. local library = {design = getgenv().design == "kali" and "kali" or "uwuware", tabs = {}, draggable = true, flags = {}, title = 'Candy Clicking Simulator', open = false, popup = nil, instances = {}, connections = {}, options = {}, notifications = {}, tabSize = 0, theme = {}, foldername = "cheatx_cnfgs", fileext = ".txt"}
  15. getgenv().library = library
  16.  
  17. --Locals
  18. local dragging, dragInput, dragStart, startPos, dragObject
  19.  
  20. local blacklistedKeys = { --add or remove keys if you find the need to
  21.     Enum.KeyCode.Unknown,Enum.KeyCode.W,Enum.KeyCode.A,Enum.KeyCode.S,Enum.KeyCode.D,Enum.KeyCode.Slash,Enum.KeyCode.Tab,Enum.KeyCode.Escape
  22. }
  23. local whitelistedMouseinputs = { --add or remove mouse inputs if you find the need to
  24.     Enum.UserInputType.MouseButton1,Enum.UserInputType.MouseButton2,Enum.UserInputType.MouseButton3
  25. }
  26.  
  27. --Functions
  28. library.round = function(num, bracket)
  29.     if typeof(num) == "Vector2" then
  30.         return Vector2.new(library.round(num.X), library.round(num.Y))
  31.     elseif typeof(num) == "Vector3" then
  32.         return Vector3.new(library.round(num.X), library.round(num.Y), library.round(num.Z))
  33.     elseif typeof(num) == "Color3" then
  34.         return library.round(num.r * 255), library.round(num.g * 255), library.round(num.b * 255)
  35.     else
  36.         return num - num % (bracket or 1);
  37.     end
  38. end
  39.  
  40. --From: https://devforum.roblox.com/t/how-to-create-a-simple-rainbow-effect-using-tweenService/221849/2
  41. local chromaColor
  42. spawn(function()
  43.     while library and wait() do
  44.         chromaColor = Color3.fromHSV(tick() % 6 / 6, 1, 1)
  45.     end
  46. end)
  47.  
  48. function library:Create(class, properties)
  49.     properties = properties or {}
  50.     if not class then return end
  51.     local a = class == "Square" or class == "Line" or class == "Text" or class == "Quad" or class == "Circle" or class == "Triangle"
  52.     local t = a and Drawing or Instance
  53.     local inst = t.new(class)
  54.     for property, value in next, properties do
  55.         inst[property] = value
  56.     end
  57.     table.insert(self.instances, {object = inst, method = a})
  58.     return inst
  59. end
  60.  
  61. function library:AddConnection(connection, name, callback)
  62.     callback = type(name) == "function" and name or callback
  63.     connection = connection:connect(callback)
  64.     if name ~= callback then
  65.         self.connections[name] = connection
  66.     else
  67.         table.insert(self.connections, connection)
  68.     end
  69.     return connection
  70. end
  71.  
  72. function library:Unload()
  73.     for _, c in next, self.connections do
  74.         c:Disconnect()
  75.     end
  76.     for _, i in next, self.instances do
  77.         if i.method then
  78.             pcall(function() i.object:Remove() end)
  79.         else
  80.             i.object:Destroy()
  81.         end
  82.     end
  83.     for _, o in next, self.options do
  84.         if o.type == "toggle" then
  85.             coroutine.resume(coroutine.create(o.SetState, o))
  86.         end
  87.     end
  88.     library = nil
  89.     getgenv().library = nil
  90. end
  91.  
  92. function library:LoadConfig(config)
  93.     if table.find(self:GetConfigs(), config) then
  94.         local Read, Config = pcall(function() return game:GetService"HttpService":JSONDecode(readfile(self.foldername .. "/" .. config .. self.fileext)) end)
  95.         Config = Read and Config or {}
  96.         for _, option in next, self.options do
  97.             if option.hasInit then
  98.                 if option.type ~= "button" and option.flag and not option.skipflag then
  99.                     if option.type == "toggle" then
  100.                         spawn(function() option:SetState(Config[option.flag] == 1) end)
  101.                     elseif option.type == "color" then
  102.                         if Config[option.flag] then
  103.                             spawn(function() option:SetColor(Config[option.flag]) end)
  104.                             if option.trans then
  105.                                 spawn(function() option:SetTrans(Config[option.flag .. " Transparency"]) end)
  106.                             end
  107.                         end
  108.                     elseif option.type == "bind" then
  109.                         spawn(function() option:SetKey(Config[option.flag]) end)
  110.                     else
  111.                         spawn(function() option:SetValue(Config[option.flag]) end)
  112.                     end
  113.                 end
  114.             end
  115.         end
  116.     end
  117. end
  118.  
  119. function library:SaveConfig(config)
  120.     local Config = {}
  121.     if table.find(self:GetConfigs(), config) then
  122.         Config = game:GetService"HttpService":JSONDecode(readfile(self.foldername .. "/" .. config .. self.fileext))
  123.     end
  124.     for _, option in next, self.options do
  125.         if option.type ~= "button" and option.flag and not option.skipflag then
  126.             if option.type == "toggle" then
  127.                 Config[option.flag] = option.state and 1 or 0
  128.             elseif option.type == "color" then
  129.                 Config[option.flag] = {option.color.r, option.color.g, option.color.b}
  130.                 if option.trans then
  131.                     Config[option.flag .. " Transparency"] = option.trans
  132.                 end
  133.             elseif option.type == "bind" then
  134.                 if option.key ~= "none" then
  135.                     Config[option.flag] = option.key
  136.                 end
  137.             elseif option.type == "list" then
  138.                 Config[option.flag] = option.value
  139.             else
  140.                 Config[option.flag] = option.value
  141.             end
  142.         end
  143.     end
  144.     writefile(self.foldername .. "/" .. config .. self.fileext, game:GetService"HttpService":JSONEncode(Config))
  145. end
  146.  
  147. function library:GetConfigs()
  148.     if not isfolder(self.foldername) then
  149.         makefolder(self.foldername)
  150.         return {}
  151.     end
  152.     local files = {}
  153.     local a = 0
  154.     for i,v in next, listfiles(self.foldername) do
  155.         if v:sub(#v - #self.fileext + 1, #v) == self.fileext then
  156.             a = a + 1
  157.             v = v:gsub(self.foldername .. "\\", "")
  158.             v = v:gsub(self.fileext, "")
  159.             table.insert(files, a, v)
  160.         end
  161.     end
  162.     return files
  163. end
  164.  
  165. library.createLabel = function(option, parent)
  166.     option.main = library:Create("TextLabel", {
  167.         LayoutOrder = option.position,
  168.         Position = UDim2.new(0, 6, 0, 0),
  169.         Size = UDim2.new(1, -12, 0, 24),
  170.         BackgroundTransparency = 1,
  171.         TextSize = 15,
  172.         Font = Enum.Font.Code,
  173.         TextColor3 = Color3.new(1, 1, 1),
  174.         TextXAlignment = Enum.TextXAlignment.Left,
  175.         TextYAlignment = Enum.TextYAlignment.Top,
  176.         TextWrapped = true,
  177.         Parent = parent
  178.     })
  179.  
  180.     setmetatable(option, {__newindex = function(t, i, v)
  181.         if i == "Text" then
  182.             option.main.Text = tostring(v)
  183.             option.main.Size = UDim2.new(1, -12, 0, textService:GetTextSize(option.main.Text, 15, Enum.Font.Code, Vector2.new(option.main.AbsoluteSize.X, 9e9)).Y + 6)
  184.         end
  185.     end})
  186.     option.Text = option.text
  187. end
  188.  
  189. library.createDivider = function(option, parent)
  190.     option.main = library:Create("Frame", {
  191.         LayoutOrder = option.position,
  192.         Size = UDim2.new(1, 0, 0, 18),
  193.         BackgroundTransparency = 1,
  194.         Parent = parent
  195.     })
  196.  
  197.     library:Create("Frame", {
  198.         AnchorPoint = Vector2.new(0.5, 0.5),
  199.         Position = UDim2.new(0.5, 0, 0.5, 0),
  200.         Size = UDim2.new(1, -24, 0, 1),
  201.         BackgroundColor3 = Color3.fromRGB(60, 60, 60),
  202.         BorderColor3 = Color3.new(),
  203.         Parent = option.main
  204.     })
  205.  
  206.     option.title = library:Create("TextLabel", {
  207.         AnchorPoint = Vector2.new(0.5, 0.5),
  208.         Position = UDim2.new(0.5, 0, 0.5, 0),
  209.         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  210.         BorderSizePixel = 0,
  211.         TextColor3 =  Color3.new(1, 1, 1),
  212.         TextSize = 15,
  213.         Font = Enum.Font.Code,
  214.         TextXAlignment = Enum.TextXAlignment.Center,
  215.         Parent = option.main
  216.     })
  217.  
  218.     setmetatable(option, {__newindex = function(t, i, v)
  219.         if i == "Text" then
  220.             if v then
  221.                 option.title.Text = tostring(v)
  222.                 option.title.Size = UDim2.new(0, textService:GetTextSize(option.title.Text, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X + 12, 0, 20)
  223.                 option.main.Size = UDim2.new(1, 0, 0, 18)
  224.             else
  225.                 option.title.Text = ""
  226.                 option.title.Size = UDim2.new()
  227.                 option.main.Size = UDim2.new(1, 0, 0, 6)
  228.             end
  229.         end
  230.     end})
  231.     option.Text = option.text
  232. end
  233.  
  234. library.createToggle = function(option, parent)
  235.     option.hasInit = true
  236.  
  237.     option.main = library:Create("Frame", {
  238.         LayoutOrder = option.position,
  239.         Size = UDim2.new(1, 0, 0, 20),
  240.         BackgroundTransparency = 1,
  241.         Parent = parent
  242.     })
  243.  
  244.     local tickbox
  245.     local tickboxOverlay
  246.     if option.style then
  247.         tickbox = library:Create("ImageLabel", {
  248.             Position = UDim2.new(0, 6, 0, 4),
  249.             Size = UDim2.new(0, 12, 0, 12),
  250.             BackgroundTransparency = 1,
  251.             Image = "rbxassetid://3570695787",
  252.             ImageColor3 = Color3.new(),
  253.             Parent = option.main
  254.         })
  255.  
  256.         library:Create("ImageLabel", {
  257.             AnchorPoint = Vector2.new(0.5, 0.5),
  258.             Position = UDim2.new(0.5, 0, 0.5, 0),
  259.             Size = UDim2.new(1, -2, 1, -2),
  260.             BackgroundTransparency = 1,
  261.             Image = "rbxassetid://3570695787",
  262.             ImageColor3 = Color3.fromRGB(60, 60, 60),
  263.             Parent = tickbox
  264.         })
  265.  
  266.         library:Create("ImageLabel", {
  267.             AnchorPoint = Vector2.new(0.5, 0.5),
  268.             Position = UDim2.new(0.5, 0, 0.5, 0),
  269.             Size = UDim2.new(1, -6, 1, -6),
  270.             BackgroundTransparency = 1,
  271.             Image = "rbxassetid://3570695787",
  272.             ImageColor3 = Color3.fromRGB(40, 40, 40),
  273.             Parent = tickbox
  274.         })
  275.  
  276.         tickboxOverlay = library:Create("ImageLabel", {
  277.             AnchorPoint = Vector2.new(0.5, 0.5),
  278.             Position = UDim2.new(0.5, 0, 0.5, 0),
  279.             Size = UDim2.new(1, -6, 1, -6),
  280.             BackgroundTransparency = 1,
  281.             Image = "rbxassetid://3570695787",
  282.             ImageColor3 = library.flags["Menu Accent Color"],
  283.             Visible = option.state,
  284.             Parent = tickbox
  285.         })
  286.  
  287.         library:Create("ImageLabel", {
  288.             AnchorPoint = Vector2.new(0.5, 0.5),
  289.             Position = UDim2.new(0.5, 0, 0.5, 0),
  290.             Size = UDim2.new(1, 0, 1, 0),
  291.             BackgroundTransparency = 1,
  292.             Image = "rbxassetid://5941353943",
  293.             ImageTransparency = 0.6,
  294.             Parent = tickbox
  295.         })
  296.  
  297.         table.insert(library.theme, tickboxOverlay)
  298.     else
  299.         tickbox = library:Create("Frame", {
  300.             Position = UDim2.new(0, 6, 0, 4),
  301.             Size = UDim2.new(0, 12, 0, 12),
  302.             BackgroundColor3 = library.flags["Menu Accent Color"],
  303.             BorderColor3 = Color3.new(),
  304.             Parent = option.main
  305.         })
  306.  
  307.         tickboxOverlay = library:Create("ImageLabel", {
  308.             Size = UDim2.new(1, 0, 1, 0),
  309.             BackgroundTransparency = option.state and 1 or 0,
  310.             BackgroundColor3 = Color3.fromRGB(50, 50, 50),
  311.             BorderColor3 = Color3.new(),
  312.             Image = "rbxassetid://4155801252",
  313.             ImageTransparency = 0.6,
  314.             ImageColor3 = Color3.new(),
  315.             Parent = tickbox
  316.         })
  317.  
  318.         library:Create("ImageLabel", {
  319.             Size = UDim2.new(1, 0, 1, 0),
  320.             BackgroundTransparency = 1,
  321.             Image = "rbxassetid://2592362371",
  322.             ImageColor3 = Color3.fromRGB(60, 60, 60),
  323.             ScaleType = Enum.ScaleType.Slice,
  324.             SliceCenter = Rect.new(2, 2, 62, 62),
  325.             Parent = tickbox
  326.         })
  327.  
  328.         library:Create("ImageLabel", {
  329.             Size = UDim2.new(1, -2, 1, -2),
  330.             Position = UDim2.new(0, 1, 0, 1),
  331.             BackgroundTransparency = 1,
  332.             Image = "rbxassetid://2592362371",
  333.             ImageColor3 = Color3.new(),
  334.             ScaleType = Enum.ScaleType.Slice,
  335.             SliceCenter = Rect.new(2, 2, 62, 62),
  336.             Parent = tickbox
  337.         })
  338.  
  339.         table.insert(library.theme, tickbox)
  340.     end
  341.  
  342.     option.interest = library:Create("Frame", {
  343.         Position = UDim2.new(0, 0, 0, 0),
  344.         Size = UDim2.new(1, 0, 0, 20),
  345.         BackgroundTransparency = 1,
  346.         Parent = option.main
  347.     })
  348.  
  349.     option.title = library:Create("TextLabel", {
  350.         Position = UDim2.new(0, 24, 0, 0),
  351.         Size = UDim2.new(1, 0, 1, 0),
  352.         BackgroundTransparency = 1,
  353.         Text = option.text,
  354.         TextColor3 =  option.state and Color3.fromRGB(210, 210, 210) or Color3.fromRGB(180, 180, 180),
  355.         TextSize = 15,
  356.         Font = Enum.Font.Code,
  357.         TextXAlignment = Enum.TextXAlignment.Left,
  358.         Parent = option.interest
  359.     })
  360.  
  361.     option.interest.InputBegan:connect(function(input)
  362.         if input.UserInputType.Name == "MouseButton1" then
  363.             option:SetState(not option.state)
  364.         end
  365.         if input.UserInputType.Name == "MouseMovement" then
  366.             if not library.warning and not library.slider then
  367.                 if option.style then
  368.                     tickbox.ImageColor3 = library.flags["Menu Accent Color"]
  369.                     --tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = library.flags["Menu Accent Color"]}):Play()
  370.                 else
  371.                     tickbox.BorderColor3 = library.flags["Menu Accent Color"]
  372.                     tickboxOverlay.BorderColor3 = library.flags["Menu Accent Color"]
  373.                     --tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = library.flags["Menu Accent Color"]}):Play()
  374.                     --tweenService:Create(tickboxOverlay, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = library.flags["Menu Accent Color"]}):Play()
  375.                 end
  376.             end
  377.             if option.tip then
  378.                 library.tooltip.Text = option.tip
  379.                 library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
  380.             end
  381.         end
  382.     end)
  383.  
  384.     option.interest.InputChanged:connect(function(input)
  385.         if input.UserInputType.Name == "MouseMovement" then
  386.             if option.tip then
  387.                 library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
  388.             end
  389.         end
  390.     end)
  391.  
  392.     option.interest.InputEnded:connect(function(input)
  393.         if input.UserInputType.Name == "MouseMovement" then
  394.             if option.style then
  395.                 tickbox.ImageColor3 = Color3.new()
  396.                 --tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.new()}):Play()
  397.             else
  398.                 tickbox.BorderColor3 = Color3.new()
  399.                 tickboxOverlay.BorderColor3 = Color3.new()
  400.                 --tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.new()}):Play()
  401.                 --tweenService:Create(tickboxOverlay, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.new()}):Play()
  402.             end
  403.             library.tooltip.Position = UDim2.new(2)
  404.         end
  405.     end)
  406.  
  407.     function option:SetState(state, nocallback)
  408.         state = typeof(state) == "boolean" and state
  409.         state = state or false
  410.         library.flags[self.flag] = state
  411.         self.state = state
  412.         option.title.TextColor3 = state and Color3.fromRGB(210, 210, 210) or Color3.fromRGB(160, 160, 160)
  413.         if option.style then
  414.             tickboxOverlay.Visible = state
  415.         else
  416.             tickboxOverlay.BackgroundTransparency = state and 1 or 0
  417.         end
  418.         if not nocallback then
  419.             self.callback(state)
  420.         end
  421.     end
  422.  
  423.     if option.state ~= nil then
  424.         delay(1, function()
  425.             if library then
  426.                 option.callback(option.state)
  427.             end
  428.         end)
  429.     end
  430.  
  431.     setmetatable(option, {__newindex = function(t, i, v)
  432.         if i == "Text" then
  433.             option.title.Text = tostring(v)
  434.         end
  435.     end})
  436. end
  437.  
  438. library.createButton = function(option, parent)
  439.     option.hasInit = true
  440.  
  441.     option.main = library:Create("Frame", {
  442.         LayoutOrder = option.position,
  443.         Size = UDim2.new(1, 0, 0, 28),
  444.         BackgroundTransparency = 1,
  445.         Parent = parent
  446.     })
  447.  
  448.     option.title = library:Create("TextLabel", {
  449.         AnchorPoint = Vector2.new(0.5, 1),
  450.         Position = UDim2.new(0.5, 0, 1, -5),
  451.         Size = UDim2.new(1, -12, 0, 20),
  452.         BackgroundColor3 = Color3.fromRGB(50, 50, 50),
  453.         BorderColor3 = Color3.new(),
  454.         Text = option.text,
  455.         TextColor3 = Color3.new(1, 1, 1),
  456.         TextSize = 15,
  457.         Font = Enum.Font.Code,
  458.         Parent = option.main
  459.     })
  460.  
  461.     library:Create("ImageLabel", {
  462.         Size = UDim2.new(1, 0, 1, 0),
  463.         BackgroundTransparency = 1,
  464.         Image = "rbxassetid://2592362371",
  465.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  466.         ScaleType = Enum.ScaleType.Slice,
  467.         SliceCenter = Rect.new(2, 2, 62, 62),
  468.         Parent = option.title
  469.     })
  470.  
  471.     library:Create("ImageLabel", {
  472.         Size = UDim2.new(1, -2, 1, -2),
  473.         Position = UDim2.new(0, 1, 0, 1),
  474.         BackgroundTransparency = 1,
  475.         Image = "rbxassetid://2592362371",
  476.         ImageColor3 = Color3.new(),
  477.         ScaleType = Enum.ScaleType.Slice,
  478.         SliceCenter = Rect.new(2, 2, 62, 62),
  479.         Parent = option.title
  480.     })
  481.  
  482.     library:Create("UIGradient", {
  483.         Color = ColorSequence.new({
  484.             ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 180, 180)),
  485.             ColorSequenceKeypoint.new(1, Color3.fromRGB(253, 253, 253)),
  486.         }),
  487.         Rotation = -90,
  488.         Parent = option.title
  489.     })
  490.  
  491.     option.title.InputBegan:connect(function(input)
  492.         if input.UserInputType.Name == "MouseButton1" then
  493.             option.callback()
  494.             if library then
  495.                 library.flags[option.flag] = true
  496.             end
  497.             if option.tip then
  498.                 library.tooltip.Text = option.tip
  499.                 library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
  500.             end
  501.         end
  502.         if input.UserInputType.Name == "MouseMovement" then
  503.             if not library.warning and not library.slider then
  504.                 option.title.BorderColor3 = library.flags["Menu Accent Color"]
  505.             end
  506.         end
  507.     end)
  508.  
  509.     option.title.InputChanged:connect(function(input)
  510.         if input.UserInputType.Name == "MouseMovement" then
  511.             if option.tip then
  512.                 library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
  513.             end
  514.         end
  515.     end)
  516.  
  517.     option.title.InputEnded:connect(function(input)
  518.         if input.UserInputType.Name == "MouseMovement" then
  519.             option.title.BorderColor3 = Color3.new()
  520.             library.tooltip.Position = UDim2.new(2)
  521.         end
  522.     end)
  523. end
  524.  
  525. library.createBind = function(option, parent)
  526.     option.hasInit = true
  527.  
  528.     local binding
  529.     local holding
  530.     local Loop
  531.  
  532.     if option.sub then
  533.         option.main = option:getMain()
  534.     else
  535.         option.main = option.main or library:Create("Frame", {
  536.             LayoutOrder = option.position,
  537.             Size = UDim2.new(1, 0, 0, 20),
  538.             BackgroundTransparency = 1,
  539.             Parent = parent
  540.         })
  541.  
  542.         library:Create("TextLabel", {
  543.             Position = UDim2.new(0, 6, 0, 0),
  544.             Size = UDim2.new(1, -12, 1, 0),
  545.             BackgroundTransparency = 1,
  546.             Text = option.text,
  547.             TextSize = 15,
  548.             Font = Enum.Font.Code,
  549.             TextColor3 = Color3.fromRGB(210, 210, 210),
  550.             TextXAlignment = Enum.TextXAlignment.Left,
  551.             Parent = option.main
  552.         })
  553.     end
  554.  
  555.     local bindinput = library:Create(option.sub and "TextButton" or "TextLabel", {
  556.         Position = UDim2.new(1, -6 - (option.subpos or 0), 0, option.sub and 2 or 3),
  557.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  558.         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  559.         BorderSizePixel = 0,
  560.         TextSize = 15,
  561.         Font = Enum.Font.Code,
  562.         TextColor3 = Color3.fromRGB(160, 160, 160),
  563.         TextXAlignment = Enum.TextXAlignment.Right,
  564.         Parent = option.main
  565.     })
  566.  
  567.     if option.sub then
  568.         bindinput.AutoButtonColor = false
  569.     end
  570.  
  571.     local interest = option.sub and bindinput or option.main
  572.     local inContact
  573.     interest.InputEnded:connect(function(input)
  574.         if input.UserInputType.Name == "MouseButton1" then
  575.             binding = true
  576.             bindinput.Text = "[...]"
  577.             bindinput.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 16, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 16)
  578.             bindinput.TextColor3 = library.flags["Menu Accent Color"]
  579.         end
  580.     end)
  581.  
  582.     library:AddConnection(inputService.InputBegan, function(input)
  583.         if inputService:GetFocusedTextBox() then return end
  584.         if binding then
  585.             local key = (table.find(whitelistedMouseinputs, input.UserInputType) and not option.nomouse) and input.UserInputType
  586.             option:SetKey(key or (not table.find(blacklistedKeys, input.KeyCode)) and input.KeyCode)
  587.         else
  588.             if (input.KeyCode.Name == option.key or input.UserInputType.Name == option.key) and not binding then
  589.                 if option.mode == "toggle" then
  590.                     library.flags[option.flag] = not library.flags[option.flag]
  591.                     option.callback(library.flags[option.flag], 0)
  592.                 else
  593.                     library.flags[option.flag] = true
  594.                     if Loop then Loop:Disconnect() option.callback(true, 0) end
  595.                     Loop = library:AddConnection(runService.RenderStepped, function(step)
  596.                         if not inputService:GetFocusedTextBox() then
  597.                             option.callback(nil, step)
  598.                         end
  599.                     end)
  600.                 end
  601.             end
  602.         end
  603.     end)
  604.  
  605.     library:AddConnection(inputService.InputEnded, function(input)
  606.         if option.key ~= "none" then
  607.             if input.KeyCode.Name == option.key or input.UserInputType.Name == option.key then
  608.                 if Loop then
  609.                     Loop:Disconnect()
  610.                     library.flags[option.flag] = false
  611.                     option.callback(true, 0)
  612.                 end
  613.             end
  614.         end
  615.     end)
  616.  
  617.     function option:SetKey(key)
  618.         binding = false
  619.         bindinput.TextColor3 = Color3.fromRGB(160, 160, 160)
  620.         if Loop then Loop:Disconnect() library.flags[option.flag] = false option.callback(true, 0) end
  621.         self.key = (key and key.Name) or key or self.key
  622.         if self.key == "Backspace" then
  623.             self.key = "none"
  624.             bindinput.Text = "[NONE]"
  625.         else
  626.             local a = self.key
  627.             if self.key:match"Mouse" then
  628.                 a = self.key:gsub("Button", ""):gsub("Mouse", "M")
  629.             elseif self.key:match"Shift" or self.key:match"Alt" or self.key:match"Control" then
  630.                 a = self.key:gsub("Left", "L"):gsub("Right", "R")
  631.             end
  632.             bindinput.Text = "[" .. a:gsub("Control", "CTRL"):upper() .. "]"
  633.         end
  634.         bindinput.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 16, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 16)
  635.     end
  636.     option:SetKey()
  637. end
  638.  
  639. library.createSlider = function(option, parent)
  640.     option.hasInit = true
  641.  
  642.     if option.sub then
  643.         option.main = option:getMain()
  644.         option.main.Size = UDim2.new(1, 0, 0, 42)
  645.     else
  646.         option.main = library:Create("Frame", {
  647.             LayoutOrder = option.position,
  648.             Size = UDim2.new(1, 0, 0, option.textpos and 24 or 40),
  649.             BackgroundTransparency = 1,
  650.             Parent = parent
  651.         })
  652.     end
  653.  
  654.     option.slider = library:Create("Frame", {
  655.         Position = UDim2.new(0, 6, 0, (option.sub and 22 or option.textpos and 4 or 20)),
  656.         Size = UDim2.new(1, -12, 0, 16),
  657.         BackgroundColor3 = Color3.fromRGB(50, 50, 50),
  658.         BorderColor3 = Color3.new(),
  659.         Parent = option.main
  660.     })
  661.  
  662.     library:Create("ImageLabel", {
  663.         Size = UDim2.new(1, 0, 1, 0),
  664.         BackgroundTransparency = 1,
  665.         Image = "rbxassetid://2454009026",
  666.         ImageColor3 = Color3.new(),
  667.         ImageTransparency = 0.8,
  668.         Parent = option.slider
  669.     })
  670.  
  671.     option.fill = library:Create("Frame", {
  672.         BackgroundColor3 = library.flags["Menu Accent Color"],
  673.         BorderSizePixel = 0,
  674.         Parent = option.slider
  675.     })
  676.  
  677.     library:Create("ImageLabel", {
  678.         Size = UDim2.new(1, 0, 1, 0),
  679.         BackgroundTransparency = 1,
  680.         Image = "rbxassetid://2592362371",
  681.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  682.         ScaleType = Enum.ScaleType.Slice,
  683.         SliceCenter = Rect.new(2, 2, 62, 62),
  684.         Parent = option.slider
  685.     })
  686.  
  687.     library:Create("ImageLabel", {
  688.         Size = UDim2.new(1, -2, 1, -2),
  689.         Position = UDim2.new(0, 1, 0, 1),
  690.         BackgroundTransparency = 1,
  691.         Image = "rbxassetid://2592362371",
  692.         ImageColor3 = Color3.new(),
  693.         ScaleType = Enum.ScaleType.Slice,
  694.         SliceCenter = Rect.new(2, 2, 62, 62),
  695.         Parent = option.slider
  696.     })
  697.  
  698.     option.title = library:Create("TextBox", {
  699.         Position = UDim2.new((option.sub or option.textpos) and 0.5 or 0, (option.sub or option.textpos) and 0 or 6, 0, 0),
  700.         Size = UDim2.new(0, 0, 0, (option.sub or option.textpos) and 14 or 18),
  701.         BackgroundTransparency = 1,
  702.         Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix,
  703.         TextSize = (option.sub or option.textpos) and 14 or 15,
  704.         Font = Enum.Font.Code,
  705.         TextColor3 = Color3.fromRGB(210, 210, 210),
  706.         TextXAlignment = Enum.TextXAlignment[(option.sub or option.textpos) and "Center" or "Left"],
  707.         Parent = (option.sub or option.textpos) and option.slider or option.main
  708.     })
  709.     table.insert(library.theme, option.fill)
  710.  
  711.     library:Create("UIGradient", {
  712.         Color = ColorSequence.new({
  713.             ColorSequenceKeypoint.new(0, Color3.fromRGB(115, 115, 115)),
  714.             ColorSequenceKeypoint.new(1, Color3.new(1, 1, 1)),
  715.         }),
  716.         Rotation = -90,
  717.         Parent = option.fill
  718.     })
  719.  
  720.     if option.min >= 0 then
  721.         option.fill.Size = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 1, 0)
  722.     else
  723.         option.fill.Position = UDim2.new((0 - option.min) / (option.max - option.min), 0, 0, 0)
  724.         option.fill.Size = UDim2.new(option.value / (option.max - option.min), 0, 1, 0)
  725.     end
  726.  
  727.     local manualInput
  728.     option.title.Focused:connect(function()
  729.         if not manualInput then
  730.             option.title:ReleaseFocus()
  731.             option.title.Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix
  732.         end
  733.     end)
  734.  
  735.     option.title.FocusLost:connect(function()
  736.         option.slider.BorderColor3 = Color3.new()
  737.         if manualInput then
  738.             if tonumber(option.title.Text) then
  739.                 option:SetValue(tonumber(option.title.Text))
  740.             else
  741.                 option.title.Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix
  742.             end
  743.         end
  744.         manualInput = false
  745.     end)
  746.  
  747.     local interest = (option.sub or option.textpos) and option.slider or option.main
  748.     interest.InputBegan:connect(function(input)
  749.         if input.UserInputType.Name == "MouseButton1" then
  750.             if inputService:IsKeyDown(Enum.KeyCode.LeftControl) or inputService:IsKeyDown(Enum.KeyCode.RightControl) then
  751.                 manualInput = true
  752.                 option.title:CaptureFocus()
  753.             else
  754.                 library.slider = option
  755.                 option.slider.BorderColor3 = library.flags["Menu Accent Color"]
  756.                 option:SetValue(option.min + ((input.Position.X - option.slider.AbsolutePosition.X) / option.slider.AbsoluteSize.X) * (option.max - option.min))
  757.             end
  758.         end
  759.         if input.UserInputType.Name == "MouseMovement" then
  760.             if not library.warning and not library.slider then
  761.                 option.slider.BorderColor3 = library.flags["Menu Accent Color"]
  762.             end
  763.             if option.tip then
  764.                 library.tooltip.Text = option.tip
  765.                 library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
  766.             end
  767.         end
  768.     end)
  769.  
  770.     interest.InputChanged:connect(function(input)
  771.         if input.UserInputType.Name == "MouseMovement" then
  772.             if option.tip then
  773.                 library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
  774.             end
  775.         end
  776.     end)
  777.  
  778.     interest.InputEnded:connect(function(input)
  779.         if input.UserInputType.Name == "MouseMovement" then
  780.             library.tooltip.Position = UDim2.new(2)
  781.             if option ~= library.slider then
  782.                 option.slider.BorderColor3 = Color3.new()
  783.                 --option.fill.BorderColor3 = Color3.new()
  784.             end
  785.         end
  786.     end)
  787.  
  788.     function option:SetValue(value, nocallback)
  789.         if typeof(value) ~= "number" then value = 0 end
  790.         value = library.round(value, option.float)
  791.         value = math.clamp(value, self.min, self.max)
  792.         if self.min >= 0 then
  793.             option.fill:TweenSize(UDim2.new((value - self.min) / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.05, true)
  794.         else
  795.             option.fill:TweenPosition(UDim2.new((0 - self.min) / (self.max - self.min), 0, 0, 0), "Out", "Quad", 0.05, true)
  796.             option.fill:TweenSize(UDim2.new(value / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
  797.         end
  798.         library.flags[self.flag] = value
  799.         self.value = value
  800.         option.title.Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix
  801.         if not nocallback then
  802.             self.callback(value)
  803.         end
  804.     end
  805.     delay(1, function()
  806.         if library then
  807.             option:SetValue(option.value)
  808.         end
  809.     end)
  810. end
  811.  
  812. library.createList = function(option, parent)
  813.     option.hasInit = true
  814.  
  815.     if option.sub then
  816.         option.main = option:getMain()
  817.         option.main.Size = UDim2.new(1, 0, 0, 48)
  818.     else
  819.         option.main = library:Create("Frame", {
  820.             LayoutOrder = option.position,
  821.             Size = UDim2.new(1, 0, 0, option.text == "nil" and 30 or 48),
  822.             BackgroundTransparency = 1,
  823.             Parent = parent
  824.         })
  825.  
  826.         if option.text ~= "nil" then
  827.             library:Create("TextLabel", {
  828.                 Position = UDim2.new(0, 6, 0, 0),
  829.                 Size = UDim2.new(1, -12, 0, 18),
  830.                 BackgroundTransparency = 1,
  831.                 Text = option.text,
  832.                 TextSize = 15,
  833.                 Font = Enum.Font.Code,
  834.                 TextColor3 = Color3.fromRGB(210, 210, 210),
  835.                 TextXAlignment = Enum.TextXAlignment.Left,
  836.                 Parent = option.main
  837.             })
  838.         end
  839.     end
  840.  
  841.     local function getMultiText()
  842.         local s = ""
  843.         for _, value in next, option.values do
  844.             s = s .. (option.value[value] and (tostring(value) .. ", ") or "")
  845.         end
  846.         return string.sub(s, 1, #s - 2)
  847.     end
  848.  
  849.     option.listvalue = library:Create("TextLabel", {
  850.         Position = UDim2.new(0, 6, 0, (option.text == "nil" and not option.sub) and 4 or 22),
  851.         Size = UDim2.new(1, -12, 0, 22),
  852.         BackgroundColor3 = Color3.fromRGB(50, 50, 50),
  853.         BorderColor3 = Color3.new(),
  854.         Text = " " .. (typeof(option.value) == "string" and option.value or getMultiText()),
  855.         TextSize = 15,
  856.         Font = Enum.Font.Code,
  857.         TextColor3 = Color3.new(1, 1, 1),
  858.         TextXAlignment = Enum.TextXAlignment.Left,
  859.         TextTruncate = Enum.TextTruncate.AtEnd,
  860.         Parent = option.main
  861.     })
  862.  
  863.     library:Create("ImageLabel", {
  864.         Size = UDim2.new(1, 0, 1, 0),
  865.         BackgroundTransparency = 1,
  866.         Image = "rbxassetid://2454009026",
  867.         ImageColor3 = Color3.new(),
  868.         ImageTransparency = 0.8,
  869.         Parent = option.listvalue
  870.     })
  871.  
  872.     library:Create("ImageLabel", {
  873.         Size = UDim2.new(1, 0, 1, 0),
  874.         BackgroundTransparency = 1,
  875.         Image = "rbxassetid://2592362371",
  876.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  877.         ScaleType = Enum.ScaleType.Slice,
  878.         SliceCenter = Rect.new(2, 2, 62, 62),
  879.         Parent = option.listvalue
  880.     })
  881.  
  882.     library:Create("ImageLabel", {
  883.         Size = UDim2.new(1, -2, 1, -2),
  884.         Position = UDim2.new(0, 1, 0, 1),
  885.         BackgroundTransparency = 1,
  886.         Image = "rbxassetid://2592362371",
  887.         ImageColor3 = Color3.new(),
  888.         ScaleType = Enum.ScaleType.Slice,
  889.         SliceCenter = Rect.new(2, 2, 62, 62),
  890.         Parent = option.listvalue
  891.     })
  892.  
  893.     option.arrow = library:Create("ImageLabel", {
  894.         Position = UDim2.new(1, -16, 0, 7),
  895.         Size = UDim2.new(0, 8, 0, 8),
  896.         Rotation = 90,
  897.         BackgroundTransparency = 1,
  898.         Image = "rbxassetid://4918373417",
  899.         ImageColor3 = Color3.new(1, 1, 1),
  900.         ScaleType = Enum.ScaleType.Fit,
  901.         ImageTransparency = 0.4,
  902.         Parent = option.listvalue
  903.     })
  904.  
  905.     option.holder = library:Create("TextButton", {
  906.         ZIndex = 4,
  907.         BackgroundColor3 = Color3.fromRGB(40, 40, 40),
  908.         BorderColor3 = Color3.new(),
  909.         Text = "",
  910.         AutoButtonColor = false,
  911.         Visible = false,
  912.         Parent = library.base
  913.     })
  914.  
  915.     option.content = library:Create("ScrollingFrame", {
  916.         ZIndex = 4,
  917.         Size = UDim2.new(1, 0, 1, 0),
  918.         BackgroundTransparency = 1,
  919.         BorderSizePixel = 0,
  920.         ScrollBarImageColor3 = Color3.new(),
  921.         ScrollBarThickness = 3,
  922.         ScrollingDirection = Enum.ScrollingDirection.Y,
  923.         VerticalScrollBarInset = Enum.ScrollBarInset.Always,
  924.         TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  925.         BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  926.         Parent = option.holder
  927.     })
  928.  
  929.     library:Create("ImageLabel", {
  930.         ZIndex = 4,
  931.         Size = UDim2.new(1, 0, 1, 0),
  932.         BackgroundTransparency = 1,
  933.         Image = "rbxassetid://2592362371",
  934.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  935.         ScaleType = Enum.ScaleType.Slice,
  936.         SliceCenter = Rect.new(2, 2, 62, 62),
  937.         Parent = option.holder
  938.     })
  939.  
  940.     library:Create("ImageLabel", {
  941.         ZIndex = 4,
  942.         Size = UDim2.new(1, -2, 1, -2),
  943.         Position = UDim2.new(0, 1, 0, 1),
  944.         BackgroundTransparency = 1,
  945.         Image = "rbxassetid://2592362371",
  946.         ImageColor3 = Color3.new(),
  947.         ScaleType = Enum.ScaleType.Slice,
  948.         SliceCenter = Rect.new(2, 2, 62, 62),
  949.         Parent = option.holder
  950.     })
  951.  
  952.     local layout = library:Create("UIListLayout", {
  953.         Padding = UDim.new(0, 2),
  954.         Parent = option.content
  955.     })
  956.  
  957.     library:Create("UIPadding", {
  958.         PaddingTop = UDim.new(0, 4),
  959.         PaddingLeft = UDim.new(0, 4),
  960.         Parent = option.content
  961.     })
  962.  
  963.     local valueCount = 0
  964.     layout.Changed:connect(function()
  965.         option.holder.Size = UDim2.new(0, option.listvalue.AbsoluteSize.X, 0, 8 + (valueCount > option.max and (-2 + (option.max * 22)) or layout.AbsoluteContentSize.Y))
  966.         option.content.CanvasSize = UDim2.new(0, 0, 0, 8 + layout.AbsoluteContentSize.Y)
  967.     end)
  968.     local interest = option.sub and option.listvalue or option.main
  969.  
  970.     option.listvalue.InputBegan:connect(function(input)
  971.         if input.UserInputType.Name == "MouseButton1" then
  972.             if library.popup == option then library.popup:Close() return end
  973.             if library.popup then
  974.                 library.popup:Close()
  975.             end
  976.             option.arrow.Rotation = -90
  977.             option.open = true
  978.             option.holder.Visible = true
  979.             local pos = option.main.AbsolutePosition
  980.             option.holder.Position = UDim2.new(0, pos.X + 6, 0, pos.Y + ((option.text == "nil" and not option.sub) and 66 or 84))
  981.             library.popup = option
  982.             option.listvalue.BorderColor3 = library.flags["Menu Accent Color"]
  983.         end
  984.         if input.UserInputType.Name == "MouseMovement" then
  985.             if not library.warning and not library.slider then
  986.                 option.listvalue.BorderColor3 = library.flags["Menu Accent Color"]
  987.             end
  988.         end
  989.     end)
  990.  
  991.     option.listvalue.InputEnded:connect(function(input)
  992.         if input.UserInputType.Name == "MouseMovement" then
  993.             if not option.open then
  994.                 option.listvalue.BorderColor3 = Color3.new()
  995.             end
  996.         end
  997.     end)
  998.  
  999.     interest.InputBegan:connect(function(input)
  1000.         if input.UserInputType.Name == "MouseMovement" then
  1001.             if option.tip then
  1002.                 library.tooltip.Text = option.tip
  1003.                 library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
  1004.             end
  1005.         end
  1006.     end)
  1007.  
  1008.     interest.InputChanged:connect(function(input)
  1009.         if input.UserInputType.Name == "MouseMovement" then
  1010.             if option.tip then
  1011.                 library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
  1012.             end
  1013.         end
  1014.     end)
  1015.  
  1016.     interest.InputEnded:connect(function(input)
  1017.         if input.UserInputType.Name == "MouseMovement" then
  1018.             library.tooltip.Position = UDim2.new(2)
  1019.         end
  1020.     end)
  1021.  
  1022.     local selected
  1023.     function option:AddValue(value, state)
  1024.         if self.labels[value] then return end
  1025.         valueCount = valueCount + 1
  1026.  
  1027.         if self.multiselect then
  1028.             self.values[value] = state
  1029.         else
  1030.             if not table.find(self.values, value) then
  1031.                 table.insert(self.values, value)
  1032.             end
  1033.         end
  1034.  
  1035.         local label = library:Create("TextLabel", {
  1036.             ZIndex = 4,
  1037.             Size = UDim2.new(1, 0, 0, 20),
  1038.             BackgroundTransparency = 1,
  1039.             Text = value,
  1040.             TextSize = 15,
  1041.             Font = Enum.Font.Code,
  1042.             TextTransparency = self.multiselect and (self.value[value] and 1 or 0) or self.value == value and 1 or 0,
  1043.             TextColor3 = Color3.fromRGB(210, 210, 210),
  1044.             TextXAlignment = Enum.TextXAlignment.Left,
  1045.             Parent = option.content
  1046.         })
  1047.         self.labels[value] = label
  1048.  
  1049.         local labelOverlay = library:Create("TextLabel", {
  1050.             ZIndex = 4,
  1051.             Size = UDim2.new(1, 0, 1, 0),
  1052.             BackgroundTransparency = 0.8,
  1053.             Text = " " ..value,
  1054.             TextSize = 15,
  1055.             Font = Enum.Font.Code,
  1056.             TextColor3 = library.flags["Menu Accent Color"],
  1057.             TextXAlignment = Enum.TextXAlignment.Left,
  1058.             Visible = self.multiselect and self.value[value] or self.value == value,
  1059.             Parent = label
  1060.         })
  1061.         selected = selected or self.value == value and labelOverlay
  1062.         table.insert(library.theme, labelOverlay)
  1063.  
  1064.         label.InputBegan:connect(function(input)
  1065.             if input.UserInputType.Name == "MouseButton1" then
  1066.                 if self.multiselect then
  1067.                     self.value[value] = not self.value[value]
  1068.                     self:SetValue(self.value)
  1069.                 else
  1070.                     self:SetValue(value)
  1071.                     self:Close()
  1072.                 end
  1073.             end
  1074.         end)
  1075.     end
  1076.  
  1077.     for i, value in next, option.values do
  1078.         option:AddValue(tostring(typeof(i) == "number" and value or i))
  1079.     end
  1080.  
  1081.     function option:RemoveValue(value)
  1082.         local label = self.labels[value]
  1083.         if label then
  1084.             label:Destroy()
  1085.             self.labels[value] = nil
  1086.             valueCount = valueCount - 1
  1087.             if self.multiselect then
  1088.                 self.values[value] = nil
  1089.                 self:SetValue(self.value)
  1090.             else
  1091.                 table.remove(self.values, table.find(self.values, value))
  1092.                 if self.value == value then
  1093.                     selected = nil
  1094.                     self:SetValue(self.values[1] or "")
  1095.                 end
  1096.             end
  1097.         end
  1098.     end
  1099.  
  1100.     function option:SetValue(value, nocallback)
  1101.         if self.multiselect and typeof(value) ~= "table" then
  1102.             value = {}
  1103.             for i,v in next, self.values do
  1104.                 value[v] = false
  1105.             end
  1106.         end
  1107.         self.value = typeof(value) == "table" and value or tostring(table.find(self.values, value) and value or self.values[1])
  1108.         library.flags[self.flag] = self.value
  1109.         option.listvalue.Text = " " .. (self.multiselect and getMultiText() or self.value)
  1110.         if self.multiselect then
  1111.             for name, label in next, self.labels do
  1112.                 label.TextTransparency = self.value[name] and 1 or 0
  1113.                 if label:FindFirstChild"TextLabel" then
  1114.                     label.TextLabel.Visible = self.value[name]
  1115.                 end
  1116.             end
  1117.         else
  1118.             if selected then
  1119.                 selected.TextTransparency = 0
  1120.                 if selected:FindFirstChild"TextLabel" then
  1121.                     selected.TextLabel.Visible = false
  1122.                 end
  1123.             end
  1124.             if self.labels[self.value] then
  1125.                 selected = self.labels[self.value]
  1126.                 selected.TextTransparency = 1
  1127.                 if selected:FindFirstChild"TextLabel" then
  1128.                     selected.TextLabel.Visible = true
  1129.                 end
  1130.             end
  1131.         end
  1132.         if not nocallback then
  1133.             self.callback(self.value)
  1134.         end
  1135.     end
  1136.     delay(1, function()
  1137.         if library then
  1138.             option:SetValue(option.value)
  1139.         end
  1140.     end)
  1141.  
  1142.     function option:Close()
  1143.         library.popup = nil
  1144.         option.arrow.Rotation = 90
  1145.         self.open = false
  1146.         option.holder.Visible = false
  1147.         option.listvalue.BorderColor3 = Color3.new()
  1148.     end
  1149.  
  1150.     return option
  1151. end
  1152.  
  1153. library.createBox = function(option, parent)
  1154.     option.hasInit = true
  1155.  
  1156.     option.main = library:Create("Frame", {
  1157.         LayoutOrder = option.position,
  1158.         Size = UDim2.new(1, 0, 0, option.text == "nil" and 28 or 44),
  1159.         BackgroundTransparency = 1,
  1160.         Parent = parent
  1161.     })
  1162.  
  1163.     if option.text ~= "nil" then
  1164.         option.title = library:Create("TextLabel", {
  1165.             Position = UDim2.new(0, 6, 0, 0),
  1166.             Size = UDim2.new(1, -12, 0, 18),
  1167.             BackgroundTransparency = 1,
  1168.             Text = option.text,
  1169.             TextSize = 15,
  1170.             Font = Enum.Font.Code,
  1171.             TextColor3 = Color3.fromRGB(210, 210, 210),
  1172.             TextXAlignment = Enum.TextXAlignment.Left,
  1173.             Parent = option.main
  1174.         })
  1175.     end
  1176.  
  1177.     option.holder = library:Create("Frame", {
  1178.         Position = UDim2.new(0, 6, 0, option.text == "nil" and 4 or 20),
  1179.         Size = UDim2.new(1, -12, 0, 20),
  1180.         BackgroundColor3 = Color3.fromRGB(50, 50, 50),
  1181.         BorderColor3 = Color3.new(),
  1182.         Parent = option.main
  1183.     })
  1184.  
  1185.     library:Create("ImageLabel", {
  1186.         Size = UDim2.new(1, 0, 1, 0),
  1187.         BackgroundTransparency = 1,
  1188.         Image = "rbxassetid://2454009026",
  1189.         ImageColor3 = Color3.new(),
  1190.         ImageTransparency = 0.8,
  1191.         Parent = option.holder
  1192.     })
  1193.  
  1194.     library:Create("ImageLabel", {
  1195.         Size = UDim2.new(1, 0, 1, 0),
  1196.         BackgroundTransparency = 1,
  1197.         Image = "rbxassetid://2592362371",
  1198.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  1199.         ScaleType = Enum.ScaleType.Slice,
  1200.         SliceCenter = Rect.new(2, 2, 62, 62),
  1201.         Parent = option.holder
  1202.     })
  1203.  
  1204.     library:Create("ImageLabel", {
  1205.         Size = UDim2.new(1, -2, 1, -2),
  1206.         Position = UDim2.new(0, 1, 0, 1),
  1207.         BackgroundTransparency = 1,
  1208.         Image = "rbxassetid://2592362371",
  1209.         ImageColor3 = Color3.new(),
  1210.         ScaleType = Enum.ScaleType.Slice,
  1211.         SliceCenter = Rect.new(2, 2, 62, 62),
  1212.         Parent = option.holder
  1213.     })
  1214.  
  1215.     local inputvalue = library:Create("TextBox", {
  1216.         Position = UDim2.new(0, 4, 0, 0),
  1217.         Size = UDim2.new(1, -4, 1, 0),
  1218.         BackgroundTransparency = 1,
  1219.         Text = "  " .. option.value,
  1220.         TextSize = 15,
  1221.         Font = Enum.Font.Code,
  1222.         TextColor3 = Color3.new(1, 1, 1),
  1223.         TextXAlignment = Enum.TextXAlignment.Left,
  1224.         TextWrapped = true,
  1225.         ClearTextOnFocus = false,
  1226.         Parent = option.holder
  1227.     })
  1228.  
  1229.     inputvalue.FocusLost:connect(function(enter)
  1230.         option.holder.BorderColor3 = Color3.new()
  1231.         option:SetValue(inputvalue.Text, enter)
  1232.     end)
  1233.  
  1234.     inputvalue.Focused:connect(function()
  1235.         option.holder.BorderColor3 = library.flags["Menu Accent Color"]
  1236.     end)
  1237.  
  1238.     inputvalue.InputBegan:connect(function(input)
  1239.         if input.UserInputType.Name == "MouseButton1" then
  1240.             inputvalue.Text = ""
  1241.         end
  1242.         if input.UserInputType.Name == "MouseMovement" then
  1243.             if not library.warning and not library.slider then
  1244.                 option.holder.BorderColor3 = library.flags["Menu Accent Color"]
  1245.             end
  1246.             if option.tip then
  1247.                 library.tooltip.Text = option.tip
  1248.                 library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
  1249.             end
  1250.         end
  1251.     end)
  1252.  
  1253.     inputvalue.InputChanged:connect(function(input)
  1254.         if input.UserInputType.Name == "MouseMovement" then
  1255.             if option.tip then
  1256.                 library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
  1257.             end
  1258.         end
  1259.     end)
  1260.  
  1261.     inputvalue.InputEnded:connect(function(input)
  1262.         if input.UserInputType.Name == "MouseMovement" then
  1263.             if not inputvalue:IsFocused() then
  1264.                 option.holder.BorderColor3 = Color3.new()
  1265.             end
  1266.             library.tooltip.Position = UDim2.new(2)
  1267.         end
  1268.     end)
  1269.  
  1270.     function option:SetValue(value, enter)
  1271.         if tostring(value) == "" then
  1272.             inputvalue.Text = self.value
  1273.         else
  1274.             library.flags[self.flag] = tostring(value)
  1275.             self.value = tostring(value)
  1276.             inputvalue.Text = self.value
  1277.             self.callback(value, enter)
  1278.         end
  1279.     end
  1280.     delay(1, function()
  1281.         if library then
  1282.             option:SetValue(option.value)
  1283.         end
  1284.     end)
  1285. end
  1286.  
  1287. library.createColorPickerWindow = function(option)
  1288.     option.mainHolder = library:Create("TextButton", {
  1289.         ZIndex = 4,
  1290.         --Position = UDim2.new(1, -184, 1, 6),
  1291.         Size = UDim2.new(0, option.trans and 200 or 184, 0, 264),
  1292.         BackgroundColor3 = Color3.fromRGB(40, 40, 40),
  1293.         BorderColor3 = Color3.new(),
  1294.         AutoButtonColor = false,
  1295.         Visible = false,
  1296.         Parent = library.base
  1297.     })
  1298.  
  1299.     option.rgbBox = library:Create("Frame", {
  1300.         Position = UDim2.new(0, 6, 0, 214),
  1301.         Size = UDim2.new(0, (option.mainHolder.AbsoluteSize.X - 12), 0, 20),
  1302.         BackgroundColor3 = Color3.fromRGB(57, 57, 57),
  1303.         BorderColor3 = Color3.new(),
  1304.         ZIndex = 5;
  1305.         Parent = option.mainHolder
  1306.     })
  1307.  
  1308.     library:Create("ImageLabel", {
  1309.         Size = UDim2.new(1, 0, 1, 0),
  1310.         BackgroundTransparency = 1,
  1311.         Image = "rbxassetid://2454009026",
  1312.         ImageColor3 = Color3.new(),
  1313.         ImageTransparency = 0.8,
  1314.         ZIndex = 6;
  1315.         Parent = option.rgbBox
  1316.     })
  1317.  
  1318.     library:Create("ImageLabel", {
  1319.         Size = UDim2.new(1, 0, 1, 0),
  1320.         BackgroundTransparency = 1,
  1321.         Image = "rbxassetid://2592362371",
  1322.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  1323.         ScaleType = Enum.ScaleType.Slice,
  1324.         SliceCenter = Rect.new(2, 2, 62, 62),
  1325.         ZIndex = 6;
  1326.         Parent = option.rgbBox
  1327.     })
  1328.  
  1329.     library:Create("ImageLabel", {
  1330.         Size = UDim2.new(1, -2, 1, -2),
  1331.         Position = UDim2.new(0, 1, 0, 1),
  1332.         BackgroundTransparency = 1,
  1333.         Image = "rbxassetid://2592362371",
  1334.         ImageColor3 = Color3.new(),
  1335.         ScaleType = Enum.ScaleType.Slice,
  1336.         SliceCenter = Rect.new(2, 2, 62, 62),
  1337.         ZIndex = 6;
  1338.         Parent = option.rgbBox
  1339.     })
  1340.  
  1341.     option.rgbInput = library:Create("TextBox", {
  1342.         Position = UDim2.new(0, 4, 0, 0),
  1343.         Size = UDim2.new(1, -4, 1, 0),
  1344.         BackgroundTransparency = 1,
  1345.         Text = tostring(option.color),
  1346.         TextSize = 14,
  1347.         Font = Enum.Font.Code,
  1348.         TextColor3 = Color3.new(1, 1, 1),
  1349.         TextXAlignment = Enum.TextXAlignment.Center,
  1350.         TextWrapped = true,
  1351.         ClearTextOnFocus = false,
  1352.         ZIndex = 6;
  1353.         Parent = option.rgbBox
  1354.     })
  1355.  
  1356.     option.hexBox = option.rgbBox:Clone()
  1357.     option.hexBox.Position = UDim2.new(0, 6, 0, 238)
  1358.     -- option.hexBox.Size = UDim2.new(0, (option.mainHolder.AbsoluteSize.X/2 - 10), 0, 20)
  1359.     option.hexBox.Parent = option.mainHolder
  1360.     option.hexInput = option.hexBox.TextBox;
  1361.  
  1362.     library:Create("ImageLabel", {
  1363.         ZIndex = 4,
  1364.         Size = UDim2.new(1, 0, 1, 0),
  1365.         BackgroundTransparency = 1,
  1366.         Image = "rbxassetid://2592362371",
  1367.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  1368.         ScaleType = Enum.ScaleType.Slice,
  1369.         SliceCenter = Rect.new(2, 2, 62, 62),
  1370.         Parent = option.mainHolder
  1371.     })
  1372.  
  1373.     library:Create("ImageLabel", {
  1374.         ZIndex = 4,
  1375.         Size = UDim2.new(1, -2, 1, -2),
  1376.         Position = UDim2.new(0, 1, 0, 1),
  1377.         BackgroundTransparency = 1,
  1378.         Image = "rbxassetid://2592362371",
  1379.         ImageColor3 = Color3.new(),
  1380.         ScaleType = Enum.ScaleType.Slice,
  1381.         SliceCenter = Rect.new(2, 2, 62, 62),
  1382.         Parent = option.mainHolder
  1383.     })
  1384.  
  1385.     local hue, sat, val = Color3.toHSV(option.color)
  1386.     hue, sat, val = hue == 0 and 1 or hue, sat + 0.005, val - 0.005
  1387.     local editinghue
  1388.     local editingsatval
  1389.     local editingtrans
  1390.  
  1391.     local transMain
  1392.     if option.trans then
  1393.         transMain = library:Create("ImageLabel", {
  1394.             ZIndex = 5,
  1395.             Size = UDim2.new(1, 0, 1, 0),
  1396.             BackgroundTransparency = 1,
  1397.             Image = "rbxassetid://2454009026",
  1398.             ImageColor3 = Color3.fromHSV(hue, 1, 1),
  1399.             Rotation = 180,
  1400.             Parent = library:Create("ImageLabel", {
  1401.                 ZIndex = 4,
  1402.                 AnchorPoint = Vector2.new(1, 0),
  1403.                 Position = UDim2.new(1, -6, 0, 6),
  1404.                 Size = UDim2.new(0, 10, 1, -60),
  1405.                 BorderColor3 = Color3.new(),
  1406.                 Image = "rbxassetid://4632082392",
  1407.                 ScaleType = Enum.ScaleType.Tile,
  1408.                 TileSize = UDim2.new(0, 5, 0, 5),
  1409.                 Parent = option.mainHolder
  1410.             })
  1411.         })
  1412.  
  1413.         option.transSlider = library:Create("Frame", {
  1414.             ZIndex = 5,
  1415.             Position = UDim2.new(0, 0, option.trans, 0),
  1416.             Size = UDim2.new(1, 0, 0, 2),
  1417.             BackgroundColor3 = Color3.fromRGB(38, 41, 65),
  1418.             BorderColor3 = Color3.fromRGB(255, 255, 255),
  1419.             Parent = transMain
  1420.         })
  1421.  
  1422.         transMain.InputBegan:connect(function(Input)
  1423.             if Input.UserInputType.Name == "MouseButton1" then
  1424.                 editingtrans = true
  1425.                 option:SetTrans(1 - ((Input.Position.Y - transMain.AbsolutePosition.Y) / transMain.AbsoluteSize.Y))
  1426.             end
  1427.         end)
  1428.  
  1429.         transMain.InputEnded:connect(function(Input)
  1430.             if Input.UserInputType.Name == "MouseButton1" then
  1431.                 editingtrans = false
  1432.             end
  1433.         end)
  1434.     end
  1435.  
  1436.     local hueMain = library:Create("Frame", {
  1437.         ZIndex = 4,
  1438.         AnchorPoint = Vector2.new(0, 1),
  1439.         Position = UDim2.new(0, 6, 1, -54),
  1440.         Size = UDim2.new(1, option.trans and -28 or -12, 0, 10),
  1441.         BackgroundColor3 = Color3.new(1, 1, 1),
  1442.         BorderColor3 = Color3.new(),
  1443.         Parent = option.mainHolder
  1444.     })
  1445.  
  1446.     local Gradient = library:Create("UIGradient", {
  1447.         Color = ColorSequence.new({
  1448.             ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
  1449.             ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 0, 255)),
  1450.             ColorSequenceKeypoint.new(0.33, Color3.fromRGB(0, 0, 255)),
  1451.             ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 255)),
  1452.             ColorSequenceKeypoint.new(0.67, Color3.fromRGB(0, 255, 0)),
  1453.             ColorSequenceKeypoint.new(0.83, Color3.fromRGB(255, 255, 0)),
  1454.             ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0)),
  1455.         }),
  1456.         Parent = hueMain
  1457.     })
  1458.  
  1459.     local hueSlider = library:Create("Frame", {
  1460.         ZIndex = 4,
  1461.         Position = UDim2.new(1 - hue, 0, 0, 0),
  1462.         Size = UDim2.new(0, 2, 1, 0),
  1463.         BackgroundColor3 = Color3.fromRGB(38, 41, 65),
  1464.         BorderColor3 = Color3.fromRGB(255, 255, 255),
  1465.         Parent = hueMain
  1466.     })
  1467.  
  1468.     hueMain.InputBegan:connect(function(Input)
  1469.         if Input.UserInputType.Name == "MouseButton1" then
  1470.             editinghue = true
  1471.             X = (hueMain.AbsolutePosition.X + hueMain.AbsoluteSize.X) - hueMain.AbsolutePosition.X
  1472.             X = math.clamp((Input.Position.X - hueMain.AbsolutePosition.X) / X, 0, 0.995)
  1473.             option:SetColor(Color3.fromHSV(1 - X, sat, val))
  1474.         end
  1475.     end)
  1476.  
  1477.     hueMain.InputEnded:connect(function(Input)
  1478.         if Input.UserInputType.Name == "MouseButton1" then
  1479.             editinghue = false
  1480.         end
  1481.     end)
  1482.  
  1483.     local satval = library:Create("ImageLabel", {
  1484.         ZIndex = 4,
  1485.         Position = UDim2.new(0, 6, 0, 6),
  1486.         Size = UDim2.new(1, option.trans and -28 or -12, 1, -74),
  1487.         BackgroundColor3 = Color3.fromHSV(hue, 1, 1),
  1488.         BorderColor3 = Color3.new(),
  1489.         Image = "rbxassetid://4155801252",
  1490.         ClipsDescendants = true,
  1491.         Parent = option.mainHolder
  1492.     })
  1493.  
  1494.     local satvalSlider = library:Create("Frame", {
  1495.         ZIndex = 4,
  1496.         AnchorPoint = Vector2.new(0.5, 0.5),
  1497.         Position = UDim2.new(sat, 0, 1 - val, 0),
  1498.         Size = UDim2.new(0, 4, 0, 4),
  1499.         Rotation = 45,
  1500.         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1501.         Parent = satval
  1502.     })
  1503.  
  1504.     satval.InputBegan:connect(function(Input)
  1505.         if Input.UserInputType.Name == "MouseButton1" then
  1506.             editingsatval = true
  1507.             X = (satval.AbsolutePosition.X + satval.AbsoluteSize.X) - satval.AbsolutePosition.X
  1508.             Y = (satval.AbsolutePosition.Y + satval.AbsoluteSize.Y) - satval.AbsolutePosition.Y
  1509.             X = math.clamp((Input.Position.X - satval.AbsolutePosition.X) / X, 0.005, 1)
  1510.             Y = math.clamp((Input.Position.Y - satval.AbsolutePosition.Y) / Y, 0, 0.995)
  1511.             option:SetColor(Color3.fromHSV(hue, X, 1 - Y))
  1512.         end
  1513.     end)
  1514.  
  1515.     library:AddConnection(inputService.InputChanged, function(Input)
  1516.         if Input.UserInputType.Name == "MouseMovement" then
  1517.             if editingsatval then
  1518.                 X = (satval.AbsolutePosition.X + satval.AbsoluteSize.X) - satval.AbsolutePosition.X
  1519.                 Y = (satval.AbsolutePosition.Y + satval.AbsoluteSize.Y) - satval.AbsolutePosition.Y
  1520.                 X = math.clamp((Input.Position.X - satval.AbsolutePosition.X) / X, 0.005, 1)
  1521.                 Y = math.clamp((Input.Position.Y - satval.AbsolutePosition.Y) / Y, 0, 0.995)
  1522.                 option:SetColor(Color3.fromHSV(hue, X, 1 - Y))
  1523.             elseif editinghue then
  1524.                 X = (hueMain.AbsolutePosition.X + hueMain.AbsoluteSize.X) - hueMain.AbsolutePosition.X
  1525.                 X = math.clamp((Input.Position.X - hueMain.AbsolutePosition.X) / X, 0, 0.995)
  1526.                 option:SetColor(Color3.fromHSV(1 - X, sat, val))
  1527.             elseif editingtrans then
  1528.                 option:SetTrans(1 - ((Input.Position.Y - transMain.AbsolutePosition.Y) / transMain.AbsoluteSize.Y))
  1529.             end
  1530.         end
  1531.     end)
  1532.  
  1533.     satval.InputEnded:connect(function(Input)
  1534.         if Input.UserInputType.Name == "MouseButton1" then
  1535.             editingsatval = false
  1536.         end
  1537.     end)
  1538.  
  1539.     local r, g, b = library.round(option.color)
  1540.     option.hexInput.Text = string.format("#%02x%02x%02x", r, g, b)
  1541.     option.rgbInput.Text = table.concat({r, g, b}, ",")
  1542.  
  1543.     option.rgbInput.FocusLost:connect(function()
  1544.         local r, g, b = option.rgbInput.Text:gsub("%s+", ""):match("(%d+),(%d+),(%d+)")
  1545.         if r and g and b then
  1546.             local color = Color3.fromRGB(tonumber(r), tonumber(g), tonumber(b))
  1547.             return option:SetColor(color)
  1548.         end
  1549.  
  1550.         local r, g, b = library.round(option.color)
  1551.         option.rgbInput.Text = table.concat({r, g, b}, ",")
  1552.     end)
  1553.  
  1554.     option.hexInput.FocusLost:connect(function()
  1555.         local r, g, b = option.hexInput.Text:match("#?(..)(..)(..)")
  1556.         if r and g and b then
  1557.             local color = Color3.fromRGB(tonumber("0x"..r), tonumber("0x"..g), tonumber("0x"..b))
  1558.             return option:SetColor(color)
  1559.         end
  1560.  
  1561.         local r, g, b = library.round(option.color)
  1562.         option.hexInput.Text = string.format("#%02x%02x%02x", r, g, b)
  1563.     end)
  1564.  
  1565.     function option:updateVisuals(Color)
  1566.         hue, sat, val = Color3.toHSV(Color)
  1567.         hue = hue == 0 and 1 or hue
  1568.         satval.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  1569.         if option.trans then
  1570.             transMain.ImageColor3 = Color3.fromHSV(hue, 1, 1)
  1571.         end
  1572.         hueSlider.Position = UDim2.new(1 - hue, 0, 0, 0)
  1573.         satvalSlider.Position = UDim2.new(sat, 0, 1 - val, 0)
  1574.  
  1575.         local r, g, b = library.round(Color3.fromHSV(hue, sat, val))
  1576.  
  1577.         option.hexInput.Text = string.format("#%02x%02x%02x", r, g, b)
  1578.         option.rgbInput.Text = table.concat({r, g, b}, ",")
  1579.     end
  1580.  
  1581.     return option
  1582. end
  1583.  
  1584. library.createColor = function(option, parent)
  1585.     option.hasInit = true
  1586.  
  1587.     if option.sub then
  1588.         option.main = option:getMain()
  1589.     else
  1590.         option.main = library:Create("Frame", {
  1591.             LayoutOrder = option.position,
  1592.             Size = UDim2.new(1, 0, 0, 20),
  1593.             BackgroundTransparency = 1,
  1594.             Parent = parent
  1595.         })
  1596.  
  1597.         option.title = library:Create("TextLabel", {
  1598.             Position = UDim2.new(0, 6, 0, 0),
  1599.             Size = UDim2.new(1, -12, 1, 0),
  1600.             BackgroundTransparency = 1,
  1601.             Text = option.text,
  1602.             TextSize = 15,
  1603.             Font = Enum.Font.Code,
  1604.             TextColor3 = Color3.fromRGB(210, 210, 210),
  1605.             TextXAlignment = Enum.TextXAlignment.Left,
  1606.             Parent = option.main
  1607.         })
  1608.     end
  1609.  
  1610.     option.visualize = library:Create(option.sub and "TextButton" or "Frame", {
  1611.         Position = UDim2.new(1, -(option.subpos or 0) - 24, 0, 4),
  1612.         Size = UDim2.new(0, 18, 0, 12),
  1613.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  1614.         BackgroundColor3 = option.color,
  1615.         BorderColor3 = Color3.new(),
  1616.         Parent = option.main
  1617.     })
  1618.  
  1619.     library:Create("ImageLabel", {
  1620.         Size = UDim2.new(1, 0, 1, 0),
  1621.         BackgroundTransparency = 1,
  1622.         Image = "rbxassetid://2454009026",
  1623.         ImageColor3 = Color3.new(),
  1624.         ImageTransparency = 0.6,
  1625.         Parent = option.visualize
  1626.     })
  1627.  
  1628.     library:Create("ImageLabel", {
  1629.         Size = UDim2.new(1, 0, 1, 0),
  1630.         BackgroundTransparency = 1,
  1631.         Image = "rbxassetid://2592362371",
  1632.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  1633.         ScaleType = Enum.ScaleType.Slice,
  1634.         SliceCenter = Rect.new(2, 2, 62, 62),
  1635.         Parent = option.visualize
  1636.     })
  1637.  
  1638.     library:Create("ImageLabel", {
  1639.         Size = UDim2.new(1, -2, 1, -2),
  1640.         Position = UDim2.new(0, 1, 0, 1),
  1641.         BackgroundTransparency = 1,
  1642.         Image = "rbxassetid://2592362371",
  1643.         ImageColor3 = Color3.new(),
  1644.         ScaleType = Enum.ScaleType.Slice,
  1645.         SliceCenter = Rect.new(2, 2, 62, 62),
  1646.         Parent = option.visualize
  1647.     })
  1648.  
  1649.     local interest = option.sub and option.visualize or option.main
  1650.  
  1651.     if option.sub then
  1652.         option.visualize.Text = ""
  1653.         option.visualize.AutoButtonColor = false
  1654.     end
  1655.  
  1656.     interest.InputBegan:connect(function(input)
  1657.         if input.UserInputType.Name == "MouseButton1" then
  1658.             if not option.mainHolder then library.createColorPickerWindow(option) end
  1659.             if library.popup == option then library.popup:Close() return end
  1660.             if library.popup then library.popup:Close() end
  1661.             option.open = true
  1662.             local pos = option.main.AbsolutePosition
  1663.             option.mainHolder.Position = UDim2.new(0, pos.X + 36 + (option.trans and -16 or 0), 0, pos.Y + 56)
  1664.             option.mainHolder.Visible = true
  1665.             library.popup = option
  1666.             option.visualize.BorderColor3 = library.flags["Menu Accent Color"]
  1667.         end
  1668.         if input.UserInputType.Name == "MouseMovement" then
  1669.             if not library.warning and not library.slider then
  1670.                 option.visualize.BorderColor3 = library.flags["Menu Accent Color"]
  1671.             end
  1672.             if option.tip then
  1673.                 library.tooltip.Text = option.tip
  1674.                 library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
  1675.             end
  1676.         end
  1677.     end)
  1678.  
  1679.     interest.InputChanged:connect(function(input)
  1680.         if input.UserInputType.Name == "MouseMovement" then
  1681.             if option.tip then
  1682.                 library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
  1683.             end
  1684.         end
  1685.     end)
  1686.  
  1687.     interest.InputEnded:connect(function(input)
  1688.         if input.UserInputType.Name == "MouseMovement" then
  1689.             if not option.open then
  1690.                 option.visualize.BorderColor3 = Color3.new()
  1691.             end
  1692.             library.tooltip.Position = UDim2.new(2)
  1693.         end
  1694.     end)
  1695.  
  1696.     function option:SetColor(newColor, nocallback)
  1697.         if typeof(newColor) == "table" then
  1698.             newColor = Color3.new(newColor[1], newColor[2], newColor[3])
  1699.         end
  1700.         newColor = newColor or Color3.new(1, 1, 1)
  1701.         if self.mainHolder then
  1702.             self:updateVisuals(newColor)
  1703.         end
  1704.         option.visualize.BackgroundColor3 = newColor
  1705.         library.flags[self.flag] = newColor
  1706.         self.color = newColor
  1707.         if not nocallback then
  1708.             self.callback(newColor)
  1709.         end
  1710.     end
  1711.  
  1712.     if option.trans then
  1713.         function option:SetTrans(value, manual)
  1714.             value = math.clamp(tonumber(value) or 0, 0, 1)
  1715.             if self.transSlider then
  1716.                 self.transSlider.Position = UDim2.new(0, 0, value, 0)
  1717.             end
  1718.             self.trans = value
  1719.             library.flags[self.flag .. " Transparency"] = 1 - value
  1720.             self.calltrans(value)
  1721.         end
  1722.         option:SetTrans(option.trans)
  1723.     end
  1724.  
  1725.     delay(1, function()
  1726.         if library then
  1727.             option:SetColor(option.color)
  1728.         end
  1729.     end)
  1730.  
  1731.     function option:Close()
  1732.         library.popup = nil
  1733.         self.open = false
  1734.         self.mainHolder.Visible = false
  1735.         option.visualize.BorderColor3 = Color3.new()
  1736.     end
  1737. end
  1738.  
  1739. function library:AddTab(title, pos)
  1740.     local tab = {canInit = true, tabs = {}, columns = {}, title = tostring(title)}
  1741.     table.insert(self.tabs, pos or #self.tabs + 1, tab)
  1742.  
  1743.     function tab:AddColumn()
  1744.         local column = {sections = {}, position = #self.columns, canInit = true, tab = self}
  1745.         table.insert(self.columns, column)
  1746.  
  1747.         function column:AddSection(title)
  1748.             local section = {title = tostring(title), options = {}, canInit = true, column = self}
  1749.             table.insert(self.sections, section)
  1750.  
  1751.             function section:AddLabel(text)
  1752.                 local option = {text = text}
  1753.                 option.section = self
  1754.                 option.type = "label"
  1755.                 option.position = #self.options
  1756.                 option.canInit = true
  1757.                 table.insert(self.options, option)
  1758.  
  1759.                 if library.hasInit and self.hasInit then
  1760.                     library.createLabel(option, self.content)
  1761.                 else
  1762.                     option.Init = library.createLabel
  1763.                 end
  1764.  
  1765.                 return option
  1766.             end
  1767.  
  1768.             function section:AddDivider(text)
  1769.                 local option = {text = text}
  1770.                 option.section = self
  1771.                 option.type = "divider"
  1772.                 option.position = #self.options
  1773.                 option.canInit = true
  1774.                 table.insert(self.options, option)
  1775.  
  1776.                 if library.hasInit and self.hasInit then
  1777.                     library.createDivider(option, self.content)
  1778.                 else
  1779.                     option.Init = library.createDivider
  1780.                 end
  1781.  
  1782.                 return option
  1783.             end
  1784.  
  1785.             function section:AddToggle(option)
  1786.                 option = typeof(option) == "table" and option or {}
  1787.                 option.section = self
  1788.                 option.text = tostring(option.text)
  1789.                 option.state = option.state == nil and nil or (typeof(option.state) == "boolean" and option.state or false)
  1790.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1791.                 option.type = "toggle"
  1792.                 option.position = #self.options
  1793.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  1794.                 option.subcount = 0
  1795.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  1796.                 option.tip = option.tip and tostring(option.tip)
  1797.                 option.style = option.style == 2
  1798.                 library.flags[option.flag] = option.state
  1799.                 table.insert(self.options, option)
  1800.                 library.options[option.flag] = option
  1801.  
  1802.                 function option:AddColor(subOption)
  1803.                     subOption = typeof(subOption) == "table" and subOption or {}
  1804.                     subOption.sub = true
  1805.                     subOption.subpos = self.subcount * 24
  1806.                     function subOption:getMain() return option.main end
  1807.                     self.subcount = self.subcount + 1
  1808.                     return section:AddColor(subOption)
  1809.                 end
  1810.  
  1811.                 function option:AddBind(subOption)
  1812.                     subOption = typeof(subOption) == "table" and subOption or {}
  1813.                     subOption.sub = true
  1814.                     subOption.subpos = self.subcount * 24
  1815.                     function subOption:getMain() return option.main end
  1816.                     self.subcount = self.subcount + 1
  1817.                     return section:AddBind(subOption)
  1818.                 end
  1819.  
  1820.                 function option:AddList(subOption)
  1821.                     subOption = typeof(subOption) == "table" and subOption or {}
  1822.                     subOption.sub = true
  1823.                     function subOption:getMain() return option.main end
  1824.                     self.subcount = self.subcount + 1
  1825.                     return section:AddList(subOption)
  1826.                 end
  1827.  
  1828.                 function option:AddSlider(subOption)
  1829.                     subOption = typeof(subOption) == "table" and subOption or {}
  1830.                     subOption.sub = true
  1831.                     function subOption:getMain() return option.main end
  1832.                     self.subcount = self.subcount + 1
  1833.                     return section:AddSlider(subOption)
  1834.                 end
  1835.  
  1836.                 if library.hasInit and self.hasInit then
  1837.                     library.createToggle(option, self.content)
  1838.                 else
  1839.                     option.Init = library.createToggle
  1840.                 end
  1841.  
  1842.                 return option
  1843.             end
  1844.  
  1845.             function section:AddButton(option)
  1846.                 option = typeof(option) == "table" and option or {}
  1847.                 option.section = self
  1848.                 option.text = tostring(option.text)
  1849.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1850.                 option.type = "button"
  1851.                 option.position = #self.options
  1852.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  1853.                 option.subcount = 0
  1854.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  1855.                 option.tip = option.tip and tostring(option.tip)
  1856.                 table.insert(self.options, option)
  1857.                 library.options[option.flag] = option
  1858.  
  1859.                 function option:AddBind(subOption)
  1860.                     subOption = typeof(subOption) == "table" and subOption or {}
  1861.                     subOption.sub = true
  1862.                     subOption.subpos = self.subcount * 24
  1863.                     function subOption:getMain() option.main.Size = UDim2.new(1, 0, 0, 40) return option.main end
  1864.                     self.subcount = self.subcount + 1
  1865.                     return section:AddBind(subOption)
  1866.                 end
  1867.  
  1868.                 function option:AddColor(subOption)
  1869.                     subOption = typeof(subOption) == "table" and subOption or {}
  1870.                     subOption.sub = true
  1871.                     subOption.subpos = self.subcount * 24
  1872.                     function subOption:getMain() option.main.Size = UDim2.new(1, 0, 0, 40) return option.main end
  1873.                     self.subcount = self.subcount + 1
  1874.                     return section:AddColor(subOption)
  1875.                 end
  1876.  
  1877.                 if library.hasInit and self.hasInit then
  1878.                     library.createButton(option, self.content)
  1879.                 else
  1880.                     option.Init = library.createButton
  1881.                 end
  1882.  
  1883.                 return option
  1884.             end
  1885.  
  1886.             function section:AddBind(option)
  1887.                 option = typeof(option) == "table" and option or {}
  1888.                 option.section = self
  1889.                 option.text = tostring(option.text)
  1890.                 option.key = (option.key and option.key.Name) or option.key or "none"
  1891.                 option.nomouse = typeof(option.nomouse) == "boolean" and option.nomouse or false
  1892.                 option.mode = typeof(option.mode) == "string" and (option.mode == "toggle" or option.mode == "hold" and option.mode) or "toggle"
  1893.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1894.                 option.type = "bind"
  1895.                 option.position = #self.options
  1896.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  1897.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  1898.                 option.tip = option.tip and tostring(option.tip)
  1899.                 table.insert(self.options, option)
  1900.                 library.options[option.flag] = option
  1901.  
  1902.                 if library.hasInit and self.hasInit then
  1903.                     library.createBind(option, self.content)
  1904.                 else
  1905.                     option.Init = library.createBind
  1906.                 end
  1907.  
  1908.                 return option
  1909.             end
  1910.  
  1911.             function section:AddSlider(option)
  1912.                 option = typeof(option) == "table" and option or {}
  1913.                 option.section = self
  1914.                 option.text = tostring(option.text)
  1915.                 option.min = typeof(option.min) == "number" and option.min or 0
  1916.                 option.max = typeof(option.max) == "number" and option.max or 0
  1917.                 option.value = option.min < 0 and 0 or math.clamp(typeof(option.value) == "number" and option.value or option.min, option.min, option.max)
  1918.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1919.                 option.float = typeof(option.value) == "number" and option.float or 1
  1920.                 option.suffix = option.suffix and tostring(option.suffix) or ""
  1921.                 option.textpos = option.textpos == 2
  1922.                 option.type = "slider"
  1923.                 option.position = #self.options
  1924.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  1925.                 option.subcount = 0
  1926.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  1927.                 option.tip = option.tip and tostring(option.tip)
  1928.                 library.flags[option.flag] = option.value
  1929.                 table.insert(self.options, option)
  1930.                 library.options[option.flag] = option
  1931.  
  1932.                 function option:AddColor(subOption)
  1933.                     subOption = typeof(subOption) == "table" and subOption or {}
  1934.                     subOption.sub = true
  1935.                     subOption.subpos = self.subcount * 24
  1936.                     function subOption:getMain() return option.main end
  1937.                     self.subcount = self.subcount + 1
  1938.                     return section:AddColor(subOption)
  1939.                 end
  1940.  
  1941.                 function option:AddBind(subOption)
  1942.                     subOption = typeof(subOption) == "table" and subOption or {}
  1943.                     subOption.sub = true
  1944.                     subOption.subpos = self.subcount * 24
  1945.                     function subOption:getMain() return option.main end
  1946.                     self.subcount = self.subcount + 1
  1947.                     return section:AddBind(subOption)
  1948.                 end
  1949.  
  1950.                 if library.hasInit and self.hasInit then
  1951.                     library.createSlider(option, self.content)
  1952.                 else
  1953.                     option.Init = library.createSlider
  1954.                 end
  1955.  
  1956.                 return option
  1957.             end
  1958.  
  1959.             function section:AddList(option)
  1960.                 option = typeof(option) == "table" and option or {}
  1961.                 option.section = self
  1962.                 option.text = tostring(option.text)
  1963.                 option.values = typeof(option.values) == "table" and option.values or {}
  1964.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1965.                 option.multiselect = typeof(option.multiselect) == "boolean" and option.multiselect or false
  1966.                 --option.groupbox = (not option.multiselect) and (typeof(option.groupbox) == "boolean" and option.groupbox or false)
  1967.                 option.value = option.multiselect and (typeof(option.value) == "table" and option.value or {}) or tostring(option.value or option.values[1] or "")
  1968.                 if option.multiselect then
  1969.                     for i,v in next, option.values do
  1970.                         option.value[v] = false
  1971.                     end
  1972.                 end
  1973.                 option.max = option.max or 4
  1974.                 option.open = false
  1975.                 option.type = "list"
  1976.                 option.position = #self.options
  1977.                 option.labels = {}
  1978.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  1979.                 option.subcount = 0
  1980.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  1981.                 option.tip = option.tip and tostring(option.tip)
  1982.                 library.flags[option.flag] = option.value
  1983.                 table.insert(self.options, option)
  1984.                 library.options[option.flag] = option
  1985.  
  1986.                 function option:AddValue(value, state)
  1987.                     if self.multiselect then
  1988.                         self.values[value] = state
  1989.                     else
  1990.                         table.insert(self.values, value)
  1991.                     end
  1992.                 end
  1993.  
  1994.                 function option:AddColor(subOption)
  1995.                     subOption = typeof(subOption) == "table" and subOption or {}
  1996.                     subOption.sub = true
  1997.                     subOption.subpos = self.subcount * 24
  1998.                     function subOption:getMain() return option.main end
  1999.                     self.subcount = self.subcount + 1
  2000.                     return section:AddColor(subOption)
  2001.                 end
  2002.  
  2003.                 function option:AddBind(subOption)
  2004.                     subOption = typeof(subOption) == "table" and subOption or {}
  2005.                     subOption.sub = true
  2006.                     subOption.subpos = self.subcount * 24
  2007.                     function subOption:getMain() return option.main end
  2008.                     self.subcount = self.subcount + 1
  2009.                     return section:AddBind(subOption)
  2010.                 end
  2011.  
  2012.                 if library.hasInit and self.hasInit then
  2013.                     library.createList(option, self.content)
  2014.                 else
  2015.                     option.Init = library.createList
  2016.                 end
  2017.  
  2018.                 return option
  2019.             end
  2020.  
  2021.             function section:AddBox(option)
  2022.                 option = typeof(option) == "table" and option or {}
  2023.                 option.section = self
  2024.                 option.text = tostring(option.text)
  2025.                 option.value = tostring(option.value or "")
  2026.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  2027.                 option.type = "box"
  2028.                 option.position = #self.options
  2029.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  2030.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  2031.                 option.tip = option.tip and tostring(option.tip)
  2032.                 library.flags[option.flag] = option.value
  2033.                 table.insert(self.options, option)
  2034.                 library.options[option.flag] = option
  2035.  
  2036.                 if library.hasInit and self.hasInit then
  2037.                     library.createBox(option, self.content)
  2038.                 else
  2039.                     option.Init = library.createBox
  2040.                 end
  2041.  
  2042.                 return option
  2043.             end
  2044.  
  2045.             function section:AddColor(option)
  2046.                 option = typeof(option) == "table" and option or {}
  2047.                 option.section = self
  2048.                 option.text = tostring(option.text)
  2049.                 option.color = typeof(option.color) == "table" and Color3.new(option.color[1], option.color[2], option.color[3]) or option.color or Color3.new(1, 1, 1)
  2050.                 option.callback = typeof(option.callback) == "function" and option.callback or function() end
  2051.                 option.calltrans = typeof(option.calltrans) == "function" and option.calltrans or (option.calltrans == 1 and option.callback) or function() end
  2052.                 option.open = false
  2053.                 option.trans = tonumber(option.trans)
  2054.                 option.subcount = 1
  2055.                 option.type = "color"
  2056.                 option.position = #self.options
  2057.                 option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
  2058.                 option.canInit = (option.canInit ~= nil and option.canInit) or true
  2059.                 option.tip = option.tip and tostring(option.tip)
  2060.                 library.flags[option.flag] = option.color
  2061.                 table.insert(self.options, option)
  2062.                 library.options[option.flag] = option
  2063.  
  2064.                 function option:AddColor(subOption)
  2065.                     subOption = typeof(subOption) == "table" and subOption or {}
  2066.                     subOption.sub = true
  2067.                     subOption.subpos = self.subcount * 24
  2068.                     function subOption:getMain() return option.main end
  2069.                     self.subcount = self.subcount + 1
  2070.                     return section:AddColor(subOption)
  2071.                 end
  2072.  
  2073.                 if option.trans then
  2074.                     library.flags[option.flag .. " Transparency"] = option.trans
  2075.                 end
  2076.  
  2077.                 if library.hasInit and self.hasInit then
  2078.                     library.createColor(option, self.content)
  2079.                 else
  2080.                     option.Init = library.createColor
  2081.                 end
  2082.  
  2083.                 return option
  2084.             end
  2085.  
  2086.             function section:SetTitle(newTitle)
  2087.                 self.title = tostring(newTitle)
  2088.                 if self.titleText then
  2089.                     self.titleText.Text = tostring(newTitle)
  2090.                 end
  2091.             end
  2092.  
  2093.             function section:Init()
  2094.                 if self.hasInit then return end
  2095.                 self.hasInit = true
  2096.  
  2097.                 self.main = library:Create("Frame", {
  2098.                     BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2099.                     BorderColor3 = Color3.new(),
  2100.                     Parent = column.main
  2101.                 })
  2102.  
  2103.                 self.content = library:Create("Frame", {
  2104.                     Size = UDim2.new(1, 0, 1, 0),
  2105.                     BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2106.                     BorderColor3 = Color3.fromRGB(60, 60, 60),
  2107.                     BorderMode = Enum.BorderMode.Inset,
  2108.                     Parent = self.main
  2109.                 })
  2110.  
  2111.                 library:Create("ImageLabel", {
  2112.                     Size = UDim2.new(1, -2, 1, -2),
  2113.                     Position = UDim2.new(0, 1, 0, 1),
  2114.                     BackgroundTransparency = 1,
  2115.                     Image = "rbxassetid://2592362371",
  2116.                     ImageColor3 = Color3.new(),
  2117.                     ScaleType = Enum.ScaleType.Slice,
  2118.                     SliceCenter = Rect.new(2, 2, 62, 62),
  2119.                     Parent = self.main
  2120.                 })
  2121.  
  2122.                 table.insert(library.theme, library:Create("Frame", {
  2123.                     Size = UDim2.new(1, 0, 0, 1),
  2124.                     BackgroundColor3 = library.flags["Menu Accent Color"],
  2125.                     BorderSizePixel = 0,
  2126.                     BorderMode = Enum.BorderMode.Inset,
  2127.                     Parent = self.main
  2128.                 }))
  2129.  
  2130.                 local layout = library:Create("UIListLayout", {
  2131.                     HorizontalAlignment = Enum.HorizontalAlignment.Center,
  2132.                     SortOrder = Enum.SortOrder.LayoutOrder,
  2133.                     Padding = UDim.new(0, 2),
  2134.                     Parent = self.content
  2135.                 })
  2136.  
  2137.                 library:Create("UIPadding", {
  2138.                     PaddingTop = UDim.new(0, 12),
  2139.                     Parent = self.content
  2140.                 })
  2141.  
  2142.                 self.titleText = library:Create("TextLabel", {
  2143.                     AnchorPoint = Vector2.new(0, 0.5),
  2144.                     Position = UDim2.new(0, 12, 0, 0),
  2145.                     Size = UDim2.new(0, textService:GetTextSize(self.title, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X + 10, 0, 3),
  2146.                     BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2147.                     BorderSizePixel = 0,
  2148.                     Text = self.title,
  2149.                     TextSize = 15,
  2150.                     Font = Enum.Font.Code,
  2151.                     TextColor3 = Color3.new(1, 1, 1),
  2152.                     Parent = self.main
  2153.                 })
  2154.  
  2155.                 layout.Changed:connect(function()
  2156.                     self.main.Size = UDim2.new(1, 0, 0, layout.AbsoluteContentSize.Y + 16)
  2157.                 end)
  2158.  
  2159.                 for _, option in next, self.options do
  2160.                     if option.canInit then
  2161.                         option.Init(option, self.content)
  2162.                     end
  2163.                 end
  2164.             end
  2165.  
  2166.             if library.hasInit and self.hasInit then
  2167.                 section:Init()
  2168.             end
  2169.  
  2170.             return section
  2171.         end
  2172.  
  2173.         function column:Init()
  2174.             if self.hasInit then return end
  2175.             self.hasInit = true
  2176.  
  2177.             self.main = library:Create("ScrollingFrame", {
  2178.                 ZIndex = 2,
  2179.                 Position = UDim2.new(0, 6 + (self.position * 239), 0, 2),
  2180.                 Size = UDim2.new(0, 233, 1, -4),
  2181.                 BackgroundTransparency = 1,
  2182.                 BorderSizePixel = 0,
  2183.                 ScrollBarImageColor3 = Color3.fromRGB(),
  2184.                 ScrollBarThickness = 4,
  2185.                 VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar,
  2186.                 ScrollingDirection = Enum.ScrollingDirection.Y,
  2187.                 Visible = false,
  2188.                 Parent = library.columnHolder
  2189.             })
  2190.  
  2191.             local layout = library:Create("UIListLayout", {
  2192.                 HorizontalAlignment = Enum.HorizontalAlignment.Center,
  2193.                 SortOrder = Enum.SortOrder.LayoutOrder,
  2194.                 Padding = UDim.new(0, 12),
  2195.                 Parent = self.main
  2196.             })
  2197.  
  2198.             library:Create("UIPadding", {
  2199.                 PaddingTop = UDim.new(0, 8),
  2200.                 PaddingLeft = UDim.new(0, 2),
  2201.                 PaddingRight = UDim.new(0, 2),
  2202.                 Parent = self.main
  2203.             })
  2204.  
  2205.             layout.Changed:connect(function()
  2206.                 self.main.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 14)
  2207.             end)
  2208.  
  2209.             for _, section in next, self.sections do
  2210.                 if section.canInit and #section.options > 0 then
  2211.                     section:Init()
  2212.                 end
  2213.             end
  2214.         end
  2215.  
  2216.         if library.hasInit and self.hasInit then
  2217.             column:Init()
  2218.         end
  2219.  
  2220.         return column
  2221.     end
  2222.  
  2223.     function tab:Init()
  2224.         if self.hasInit then return end
  2225.         self.hasInit = true
  2226.         local size = textService:GetTextSize(self.title, 18, Enum.Font.Code, Vector2.new(9e9, 9e9)).X + 10
  2227.  
  2228.         self.button = library:Create("TextLabel", {
  2229.             Position = UDim2.new(0, library.tabSize, 0, 22),
  2230.             Size = UDim2.new(0, size, 0, 30),
  2231.             BackgroundTransparency = 1,
  2232.             Text = self.title,
  2233.             TextColor3 = Color3.new(1, 1, 1),
  2234.             TextSize = 15,
  2235.             Font = Enum.Font.Code,
  2236.             TextWrapped = true,
  2237.             ClipsDescendants = true,
  2238.             Parent = library.main
  2239.         })
  2240.         library.tabSize = library.tabSize + size
  2241.  
  2242.         self.button.InputBegan:connect(function(input)
  2243.             if input.UserInputType.Name == "MouseButton1" then
  2244.                 library:selectTab(self)
  2245.             end
  2246.         end)
  2247.  
  2248.         for _, column in next, self.columns do
  2249.             if column.canInit then
  2250.                 column:Init()
  2251.             end
  2252.         end
  2253.     end
  2254.  
  2255.     if self.hasInit then
  2256.         tab:Init()
  2257.     end
  2258.  
  2259.     return tab
  2260. end
  2261.  
  2262. function library:AddWarning(warning)
  2263.     warning = typeof(warning) == "table" and warning or {}
  2264.     warning.text = tostring(warning.text)
  2265.     warning.type = warning.type == "confirm" and "confirm" or ""
  2266.  
  2267.     local answer
  2268.     function warning:Show()
  2269.         library.warning = warning
  2270.         if warning.main and warning.type == "" then return end
  2271.         if library.popup then library.popup:Close() end
  2272.         if not warning.main then
  2273.             warning.main = library:Create("TextButton", {
  2274.                 ZIndex = 2,
  2275.                 Size = UDim2.new(1, 0, 1, 0),
  2276.                 BackgroundTransparency = 0.6,
  2277.                 BackgroundColor3 = Color3.new(),
  2278.                 BorderSizePixel = 0,
  2279.                 Text = "",
  2280.                 AutoButtonColor = false,
  2281.                 Parent = library.main
  2282.             })
  2283.  
  2284.             warning.message = library:Create("TextLabel", {
  2285.                 ZIndex = 2,
  2286.                 Position = UDim2.new(0, 20, 0.5, -60),
  2287.                 Size = UDim2.new(1, -40, 0, 40),
  2288.                 BackgroundTransparency = 1,
  2289.                 TextSize = 16,
  2290.                 Font = Enum.Font.Code,
  2291.                 TextColor3 = Color3.new(1, 1, 1),
  2292.                 TextWrapped = true,
  2293.                 RichText = true,
  2294.                 Parent = warning.main
  2295.             })
  2296.  
  2297.             if warning.type == "confirm" then
  2298.                 local button = library:Create("TextLabel", {
  2299.                     ZIndex = 2,
  2300.                     Position = UDim2.new(0.5, -105, 0.5, -10),
  2301.                     Size = UDim2.new(0, 100, 0, 20),
  2302.                     BackgroundColor3 = Color3.fromRGB(40, 40, 40),
  2303.                     BorderColor3 = Color3.new(),
  2304.                     Text = "Yes",
  2305.                     TextSize = 16,
  2306.                     Font = Enum.Font.Code,
  2307.                     TextColor3 = Color3.new(1, 1, 1),
  2308.                     Parent = warning.main
  2309.                 })
  2310.  
  2311.                 library:Create("ImageLabel", {
  2312.                     ZIndex = 2,
  2313.                     Size = UDim2.new(1, 0, 1, 0),
  2314.                     BackgroundTransparency = 1,
  2315.                     Image = "rbxassetid://2454009026",
  2316.                     ImageColor3 = Color3.new(),
  2317.                     ImageTransparency = 0.8,
  2318.                     Parent = button
  2319.                 })
  2320.  
  2321.                 library:Create("ImageLabel", {
  2322.                     ZIndex = 2,
  2323.                     Size = UDim2.new(1, 0, 1, 0),
  2324.                     BackgroundTransparency = 1,
  2325.                     Image = "rbxassetid://2592362371",
  2326.                     ImageColor3 = Color3.fromRGB(60, 60, 60),
  2327.                     ScaleType = Enum.ScaleType.Slice,
  2328.                     SliceCenter = Rect.new(2, 2, 62, 62),
  2329.                     Parent = button
  2330.                 })
  2331.  
  2332.                 local button1 = library:Create("TextLabel", {
  2333.                     ZIndex = 2,
  2334.                     Position = UDim2.new(0.5, 5, 0.5, -10),
  2335.                     Size = UDim2.new(0, 100, 0, 20),
  2336.                     BackgroundColor3 = Color3.fromRGB(40, 40, 40),
  2337.                     BorderColor3 = Color3.new(),
  2338.                     Text = "No",
  2339.                     TextSize = 16,
  2340.                     Font = Enum.Font.Code,
  2341.                     TextColor3 = Color3.new(1, 1, 1),
  2342.                     Parent = warning.main
  2343.                 })
  2344.  
  2345.                 library:Create("ImageLabel", {
  2346.                     ZIndex = 2,
  2347.                     Size = UDim2.new(1, 0, 1, 0),
  2348.                     BackgroundTransparency = 1,
  2349.                     Image = "rbxassetid://2454009026",
  2350.                     ImageColor3 = Color3.new(),
  2351.                     ImageTransparency = 0.8,
  2352.                     Parent = button1
  2353.                 })
  2354.  
  2355.                 library:Create("ImageLabel", {
  2356.                     ZIndex = 2,
  2357.                     Size = UDim2.new(1, 0, 1, 0),
  2358.                     BackgroundTransparency = 1,
  2359.                     Image = "rbxassetid://2592362371",
  2360.                     ImageColor3 = Color3.fromRGB(60, 60, 60),
  2361.                     ScaleType = Enum.ScaleType.Slice,
  2362.                     SliceCenter = Rect.new(2, 2, 62, 62),
  2363.                     Parent = button1
  2364.                 })
  2365.  
  2366.                 button.InputBegan:connect(function(input)
  2367.                     if input.UserInputType.Name == "MouseButton1" then
  2368.                         answer = true
  2369.                     end
  2370.                 end)
  2371.  
  2372.                 button1.InputBegan:connect(function(input)
  2373.                     if input.UserInputType.Name == "MouseButton1" then
  2374.                         answer = false
  2375.                     end
  2376.                 end)
  2377.             else
  2378.                 local button = library:Create("TextLabel", {
  2379.                     ZIndex = 2,
  2380.                     Position = UDim2.new(0.5, -50, 0.5, -10),
  2381.                     Size = UDim2.new(0, 100, 0, 20),
  2382.                     BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2383.                     BorderColor3 = Color3.new(),
  2384.                     Text = "OK",
  2385.                     TextSize = 16,
  2386.                     Font = Enum.Font.Code,
  2387.                     TextColor3 = Color3.new(1, 1, 1),
  2388.                     Parent = warning.main
  2389.                 })
  2390.  
  2391.                 library:Create("ImageLabel", {
  2392.                     ZIndex = 2,
  2393.                     Size = UDim2.new(1, 0, 1, 0),
  2394.                     BackgroundTransparency = 1,
  2395.                     Image = "rbxassetid://2454009026",
  2396.                     ImageColor3 = Color3.new(),
  2397.                     ImageTransparency = 0.8,
  2398.                     Parent = button
  2399.                 })
  2400.  
  2401.                 library:Create("ImageLabel", {
  2402.                     ZIndex = 2,
  2403.                     AnchorPoint = Vector2.new(0.5, 0.5),
  2404.                     Position = UDim2.new(0.5, 0, 0.5, 0),
  2405.                     Size = UDim2.new(1, -2, 1, -2),
  2406.                     BackgroundTransparency = 1,
  2407.                     Image = "rbxassetid://3570695787",
  2408.                     ImageColor3 = Color3.fromRGB(50, 50, 50),
  2409.                     Parent = button
  2410.                 })
  2411.  
  2412.                 button.InputBegan:connect(function(input)
  2413.                     if input.UserInputType.Name == "MouseButton1" then
  2414.                         answer = true
  2415.                     end
  2416.                 end)
  2417.             end
  2418.         end
  2419.         warning.main.Visible = true
  2420.         warning.message.Text = warning.text
  2421.  
  2422.         repeat wait()
  2423.         until answer ~= nil
  2424.         spawn(warning.Close)
  2425.         library.warning = nil
  2426.         return answer
  2427.     end
  2428.  
  2429.     function warning:Close()
  2430.         answer = nil
  2431.         if not warning.main then return end
  2432.         warning.main.Visible = false
  2433.     end
  2434.  
  2435.     return warning
  2436. end
  2437.  
  2438. function library:Close()
  2439.     self.open = not self.open
  2440.     if self.main then
  2441.         if self.popup then
  2442.             self.popup:Close()
  2443.         end
  2444.         self.main.Visible = self.open
  2445.     end
  2446. end
  2447.  
  2448. function library:Init()
  2449.     if self.hasInit then return end
  2450.     self.hasInit = true
  2451.  
  2452.     self.base = library:Create("ScreenGui", {IgnoreGuiInset = true, ZIndexBehavior = Enum.ZIndexBehavior.Global})
  2453.     if runService:IsStudio() then
  2454.         self.base.Parent = script.Parent.Parent
  2455.     elseif syn then
  2456.         pcall(function() self.base.RobloxLocked = true end)
  2457.         self.base.Parent = game:GetService"CoreGui"
  2458.     end
  2459.  
  2460.     self.main = self:Create("ImageButton", {
  2461.         AutoButtonColor = false,
  2462.         Position = UDim2.new(0, 100, 0, 46),
  2463.         Size = UDim2.new(0, 500, 0, 600),
  2464.         BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  2465.         BorderColor3 = Color3.new(),
  2466.         ScaleType = Enum.ScaleType.Tile,
  2467.         Modal = true,
  2468.         Visible = false,
  2469.         Parent = self.base
  2470.     })
  2471.  
  2472.     self.top = self:Create("Frame", {
  2473.         Size = UDim2.new(1, 0, 0, 50),
  2474.         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2475.         BorderColor3 = Color3.new(),
  2476.         Parent = self.main
  2477.     })
  2478.  
  2479.     self:Create("TextLabel", {
  2480.         Position = UDim2.new(0, 6, 0, -1),
  2481.         Size = UDim2.new(0, 0, 0, 20),
  2482.         BackgroundTransparency = 1,
  2483.         Text = tostring(self.title),
  2484.         Font = Enum.Font.Code,
  2485.         TextSize = 18,
  2486.         TextColor3 = Color3.new(1, 1, 1),
  2487.         TextXAlignment = Enum.TextXAlignment.Left,
  2488.         Parent = self.main
  2489.     })
  2490.  
  2491.     table.insert(library.theme, self:Create("Frame", {
  2492.         Size = UDim2.new(1, 0, 0, 1),
  2493.         Position = UDim2.new(0, 0, 0, 24),
  2494.         BackgroundColor3 = library.flags["Menu Accent Color"],
  2495.         BorderSizePixel = 0,
  2496.         Parent = self.main
  2497.     }))
  2498.  
  2499.     library:Create("ImageLabel", {
  2500.         Size = UDim2.new(1, 0, 1, 0),
  2501.         BackgroundTransparency = 1,
  2502.         Image = "rbxassetid://2454009026",
  2503.         ImageColor3 = Color3.new(),
  2504.         ImageTransparency = 0.4,
  2505.         Parent = top
  2506.     })
  2507.  
  2508.     self.tabHighlight = self:Create("Frame", {
  2509.         BackgroundColor3 = library.flags["Menu Accent Color"],
  2510.         BorderSizePixel = 0,
  2511.         Parent = self.main
  2512.     })
  2513.     table.insert(library.theme, self.tabHighlight)
  2514.  
  2515.     self.columnHolder = self:Create("Frame", {
  2516.         Position = UDim2.new(0, 5, 0, 55),
  2517.         Size = UDim2.new(1, -10, 1, -60),
  2518.         BackgroundTransparency = 1,
  2519.         Parent = self.main
  2520.     })
  2521.  
  2522.     self.tooltip = self:Create("TextLabel", {
  2523.         ZIndex = 2,
  2524.         BackgroundTransparency = 1,
  2525.         BorderSizePixel = 0,
  2526.         TextSize = 15,
  2527.         Font = Enum.Font.Code,
  2528.         TextColor3 = Color3.new(1, 1, 1),
  2529.         Visible = true,
  2530.         Parent = self.base
  2531.     })
  2532.  
  2533.     self:Create("Frame", {
  2534.         AnchorPoint = Vector2.new(0.5, 0),
  2535.         Position = UDim2.new(0.5, 0, 0, 0),
  2536.         Size = UDim2.new(1, 10, 1, 0),
  2537.         Style = Enum.FrameStyle.RobloxRound,
  2538.         Parent = self.tooltip
  2539.     })
  2540.  
  2541.     self:Create("ImageLabel", {
  2542.         Size = UDim2.new(1, 0, 1, 0),
  2543.         BackgroundTransparency = 1,
  2544.         Image = "rbxassetid://2592362371",
  2545.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  2546.         ScaleType = Enum.ScaleType.Slice,
  2547.         SliceCenter = Rect.new(2, 2, 62, 62),
  2548.         Parent = self.main
  2549.     })
  2550.  
  2551.     self:Create("ImageLabel", {
  2552.         Size = UDim2.new(1, -2, 1, -2),
  2553.         Position = UDim2.new(0, 1, 0, 1),
  2554.         BackgroundTransparency = 1,
  2555.         Image = "rbxassetid://2592362371",
  2556.         ImageColor3 = Color3.new(),
  2557.         ScaleType = Enum.ScaleType.Slice,
  2558.         SliceCenter = Rect.new(2, 2, 62, 62),
  2559.         Parent = self.main
  2560.     })
  2561.  
  2562.     self.top.InputBegan:connect(function(input)
  2563.         if input.UserInputType.Name == "MouseButton1" then
  2564.             dragObject = self.main
  2565.             dragging = true
  2566.             dragStart = input.Position
  2567.             startPos = dragObject.Position
  2568.             if library.popup then library.popup:Close() end
  2569.         end
  2570.     end)
  2571.     self.top.InputChanged:connect(function(input)
  2572.         if dragging and input.UserInputType.Name == "MouseMovement" then
  2573.             dragInput = input
  2574.         end
  2575.     end)
  2576.     self.top.InputEnded:connect(function(input)
  2577.         if input.UserInputType.Name == "MouseButton1" then
  2578.             dragging = false
  2579.         end
  2580.     end)
  2581.  
  2582.     function self:selectTab(tab)
  2583.         if self.currentTab == tab then return end
  2584.         if library.popup then library.popup:Close() end
  2585.         if self.currentTab then
  2586.             self.currentTab.button.TextColor3 = Color3.fromRGB(255, 255, 255)
  2587.             for _, column in next, self.currentTab.columns do
  2588.                 column.main.Visible = false
  2589.             end
  2590.         end
  2591.         self.main.Size = UDim2.new(0, 16 + ((#tab.columns < 2 and 2 or #tab.columns) * 239), 0, 600)
  2592.         self.currentTab = tab
  2593.         tab.button.TextColor3 = library.flags["Menu Accent Color"]
  2594.         self.tabHighlight:TweenPosition(UDim2.new(0, tab.button.Position.X.Offset, 0, 50), "Out", "Quad", 0.2, true)
  2595.         self.tabHighlight:TweenSize(UDim2.new(0, tab.button.AbsoluteSize.X, 0, -1), "Out", "Quad", 0.1, true)
  2596.         for _, column in next, tab.columns do
  2597.             column.main.Visible = true
  2598.         end
  2599.     end
  2600.  
  2601.     spawn(function()
  2602.         while library do
  2603.             wait(1)
  2604.             local Configs = self:GetConfigs()
  2605.             for _, config in next, Configs do
  2606.                 if not table.find(self.options["Config List"].values, config) then
  2607.                     self.options["Config List"]:AddValue(config)
  2608.                 end
  2609.             end
  2610.             for _, config in next, self.options["Config List"].values do
  2611.                 if not table.find(Configs, config) then
  2612.                     self.options["Config List"]:RemoveValue(config)
  2613.                 end
  2614.             end
  2615.         end
  2616.     end)
  2617.  
  2618.     for _, tab in next, self.tabs do
  2619.         if tab.canInit then
  2620.             tab:Init()
  2621.             self:selectTab(tab)
  2622.         end
  2623.     end
  2624.  
  2625.     self:AddConnection(inputService.InputEnded, function(input)
  2626.         if input.UserInputType.Name == "MouseButton1" and self.slider then
  2627.             self.slider.slider.BorderColor3 = Color3.new()
  2628.             self.slider = nil
  2629.         end
  2630.     end)
  2631.  
  2632.     self:AddConnection(inputService.InputChanged, function(input)
  2633.         if not self.open then return end
  2634.        
  2635.         if input.UserInputType.Name == "MouseMovement" then
  2636.            
  2637.             if self.slider then
  2638.                 self.slider:SetValue(self.slider.min + ((input.Position.X - self.slider.slider.AbsolutePosition.X) / self.slider.slider.AbsoluteSize.X) * (self.slider.max - self.slider.min))
  2639.             end
  2640.         end
  2641.         if input == dragInput and dragging and library.draggable then
  2642.             local delta = input.Position - dragStart
  2643.             local yPos = (startPos.Y.Offset + delta.Y) < -36 and -36 or startPos.Y.Offset + delta.Y
  2644.             dragObject:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, yPos), "Out", "Quint", 0.1, true)
  2645.         end
  2646.     end)
  2647.  
  2648.     local Old_index
  2649.     Old_index = hookmetamethod(game, "__index", function(t, i)
  2650.         if checkcaller() then return Old_index(t, i) end
  2651.  
  2652.         return Old_index(t, i)
  2653.     end)
  2654.  
  2655.     local Old_new
  2656.     Old_new = hookmetamethod(game, "__newindex", function(t, i, v)
  2657.         if checkcaller() then return Old_new(t, i, v) end
  2658.  
  2659.  
  2660.         return Old_new(t, i, v)
  2661.     end)
  2662.  
  2663.     if not getgenv().silent then
  2664.         delay(1, function() self:Close() end)
  2665.     end
  2666. end
  2667.  
  2668. local function promptLib()
  2669.     local RunService = game:GetService("RunService")
  2670.     local CoreGui = game:GetService("CoreGui")
  2671.  
  2672.     local ErrorPrompt = getrenv().require(CoreGui.RobloxGui.Modules.ErrorPrompt)
  2673.     local function NewScreen(ScreenName)
  2674.         local Screen = Instance.new("ScreenGui")
  2675.         Screen.Name = ScreenName
  2676.         Screen.ResetOnSpawn = false
  2677.         Screen.IgnoreGuiInset = true
  2678.         sethiddenproperty(Screen,
  2679.         "OnTopOfCoreBlur",true)
  2680.         Screen.RobloxLocked = true
  2681.         Screen.Parent = CoreGui
  2682.         return Screen
  2683.     end
  2684.  
  2685.     return function(Title,Message,Buttons)
  2686.         local Screen = NewScreen("Prompt")
  2687.         local Prompt = ErrorPrompt.new("Default",{
  2688.             MessageTextScaled = false,
  2689.             PlayAnimation = false,
  2690.             HideErrorCode = true
  2691.         })
  2692.         for Index,Button in pairs(Buttons) do
  2693.             local Old = Button.Callback
  2694.             Button.Callback = function(...)
  2695.                 RunService:SetRobloxGuiFocused(false)
  2696.                 Prompt:_close()
  2697.                 Screen:Destroy()
  2698.                 return Old(...)
  2699.             end
  2700.         end
  2701.  
  2702.         Prompt:setErrorTitle(Title)
  2703.         Prompt:updateButtons(Buttons)
  2704.         Prompt:setParent(Screen)
  2705.         RunService:SetRobloxGuiFocused(true)
  2706.         Prompt:_open(Message)
  2707.         return Prompt,Screen
  2708.     end
  2709. end
  2710.  
  2711. --LIBRARY END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement