Advertisement
HD_G4M3R

asssssssssssdafeeqetyyy

Nov 22nd, 2021
1,382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 60.23 KB | None | 0 0
  1. local library = {flags = {}, windows = {}, open = true}
  2.  
  3. --Services
  4. local runService = game:GetService"RunService"
  5. local tweenService = game:GetService"TweenService"
  6. local textService = game:GetService"TextService"
  7. local inputService = game:GetService"UserInputService"
  8.  
  9. --Locals
  10. local dragging, dragInput, dragStart, startPos, dragObject
  11.  
  12. local blacklistedKeys = { --add or remove keys if you find the need to
  13.     Enum.KeyCode.Unknown,Enum.KeyCode.W,Enum.KeyCode.A,Enum.KeyCode.S,Enum.KeyCode.D,Enum.KeyCode.Slash,Enum.KeyCode.Tab,Enum.KeyCode.Backspace,Enum.KeyCode.Escape
  14. }
  15. local whitelistedMouseinputs = { --add or remove mouse inputs if you find the need to
  16.     Enum.UserInputType.MouseButton1,Enum.UserInputType.MouseButton2,Enum.UserInputType.MouseButton3
  17. }
  18.  
  19. --Functions
  20. local function round(num, bracket)
  21.     bracket = bracket or 1
  22.     local a = math.floor(num/bracket + (math.sign(num) * 0.5)) * bracket
  23.     if a < 0 then
  24.         a = a + bracket
  25.     end
  26.     return a
  27. end
  28.  
  29. local function keyCheck(x,x1)
  30.     for _,v in next, x1 do
  31.         if v == x then
  32.             return true
  33.         end
  34.     end
  35. end
  36.  
  37. local function update(input)
  38.     local delta = input.Position - dragStart
  39.     local yPos = (startPos.Y.Offset + delta.Y) < -36 and -36 or startPos.Y.Offset + delta.Y
  40.     dragObject:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, yPos), "Out", "Quint", 0.1, true)
  41. end
  42.  
  43. --From: https://devforum.roblox.com/t/how-to-create-a-simple-rainbow-effect-using-tweenService/221849/2
  44. local chromaColor
  45. local rainbowTime = 5
  46. spawn(function()
  47.     while wait() do
  48.         chromaColor = Color3.fromHSV(tick() % rainbowTime / rainbowTime, 1, 1)
  49.     end
  50. end)
  51.  
  52. function library:Create(class, properties)
  53.     properties = typeof(properties) == "table" and properties or {}
  54.     local inst = Instance.new(class)
  55.     for property, value in next, properties do
  56.         inst[property] = value
  57.     end
  58.     return inst
  59. end
  60.  
  61. function library:Draw(class, properties)
  62.     local properties = type(properties) == 'table' and properties or {};
  63.  
  64.     local object = Drawing.new(class)
  65.     for p, v in next, properties do
  66.         object[p] = v;
  67.     end
  68.     return object
  69. end
  70.  
  71. local function createOptionHolder(holderTitle, parent, parentTable, subHolder)
  72.     local size = subHolder and 34 or 40
  73.     parentTable.main = library:Create("ImageButton", {
  74.         LayoutOrder = subHolder and parentTable.position or 0,
  75.         Position = UDim2.new(0, 20 + (250 * (parentTable.position or 0)), 0, 20),
  76.         Size = UDim2.new(0, 230, 0, size),
  77.         BackgroundTransparency = 1,
  78.         Image = "rbxassetid://3570695787",
  79.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  80.         ScaleType = Enum.ScaleType.Slice,
  81.         SliceCenter = Rect.new(100, 100, 100, 100),
  82.         SliceScale = 0.04,
  83.         ClipsDescendants = true,
  84.         Parent = parent
  85.     })
  86.    
  87.     local round
  88.     if not subHolder then
  89.         round = library:Create("ImageLabel", {
  90.             Size = UDim2.new(1, 0, 0, size),
  91.             BackgroundTransparency = 1,
  92.             Image = "rbxassetid://3570695787",
  93.             ImageColor3 = parentTable.open and (subHolder and Color3.fromRGB(16, 16, 16) or Color3.fromRGB(10, 10, 10)) or (subHolder and Color3.fromRGB(10, 10, 10) or Color3.fromRGB(6, 6, 6)),
  94.             ScaleType = Enum.ScaleType.Slice,
  95.             SliceCenter = Rect.new(100, 100, 100, 100),
  96.             SliceScale = 0.04,
  97.             Parent = parentTable.main
  98.         })
  99.     end
  100.    
  101.     local title = library:Create("TextLabel", {
  102.         Size = UDim2.new(1, 0, 0, size),
  103.         BackgroundTransparency = subHolder and 0 or 1,
  104.         BackgroundColor3 = Color3.fromRGB(10, 10, 10),
  105.         BorderSizePixel = 0,
  106.         Text = holderTitle,
  107.         TextSize = subHolder and 16 or 17,
  108.         Font = Enum.Font.GothamBold,
  109.         TextColor3 = Color3.fromRGB(255, 255, 255),
  110.         Parent = parentTable.main
  111.     })
  112.    
  113.     local closeHolder = library:Create("Frame", {
  114.         Position = UDim2.new(1, 0, 0, 0),
  115.         Size = UDim2.new(-1, 0, 1, 0),
  116.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  117.         BackgroundTransparency = 1,
  118.         Parent = title
  119.     })
  120.    
  121.     local close = library:Create("ImageLabel", {
  122.         AnchorPoint = Vector2.new(0.5, 0.5),
  123.         Position = UDim2.new(0.5, 0, 0.5, 0),
  124.         Size = UDim2.new(1, -size - 10, 1, -size - 10),
  125.         Rotation = parentTable.open and 90 or 180,
  126.         BackgroundTransparency = 1,
  127.         Image = "rbxassetid://4918373417",
  128.         ImageColor3 = parentTable.open and Color3.fromRGB(50, 50, 50) or Color3.fromRGB(30, 30, 30),
  129.         ScaleType = Enum.ScaleType.Fit,
  130.         Parent = closeHolder
  131.     })
  132.    
  133.     parentTable.content = library:Create("Frame", {
  134.         Position = UDim2.new(0, 0, 0, size),
  135.         Size = UDim2.new(1, 0, 1, -size),
  136.         BackgroundTransparency = 1,
  137.         Parent = parentTable.main
  138.     })
  139.    
  140.     local layout = library:Create("UIListLayout", {
  141.         SortOrder = Enum.SortOrder.LayoutOrder,
  142.         Parent = parentTable.content
  143.     })
  144.    
  145.     layout.Changed:connect(function()
  146.         parentTable.content.Size = UDim2.new(1, 0, 0, layout.AbsoluteContentSize.Y)
  147.         parentTable.main.Size = #parentTable.options > 0 and parentTable.open and UDim2.new(0, 230, 0, layout.AbsoluteContentSize.Y + size) or UDim2.new(0, 230, 0, size)
  148.     end)
  149.    
  150.     if not subHolder then
  151.         library:Create("UIPadding", {
  152.             Parent = parentTable.content
  153.         })
  154.        
  155.         title.InputBegan:connect(function(input)
  156.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  157.                 dragObject = parentTable.main
  158.                 dragging = true
  159.                 dragStart = input.Position
  160.                 startPos = dragObject.Position
  161.             end
  162.         end)
  163.         title.InputChanged:connect(function(input)
  164.             if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  165.                 dragInput = input
  166.             end
  167.         end)
  168.             title.InputEnded:connect(function(input)
  169.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  170.                 dragging = false
  171.             end
  172.         end)
  173.     end
  174.    
  175.     closeHolder.InputBegan:connect(function(input)
  176.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  177.             parentTable.open = not parentTable.open
  178.             tweenService:Create(close, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = parentTable.open and 90 or 180, ImageColor3 = parentTable.open and Color3.fromRGB(50, 50, 50) or Color3.fromRGB(30, 30, 30)}):Play()
  179.             if subHolder then
  180.                 tweenService:Create(title, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = parentTable.open and Color3.fromRGB(16, 16, 16) or Color3.fromRGB(10, 10, 10)}):Play()
  181.             else
  182.                 tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = parentTable.open and Color3.fromRGB(10, 10, 10) or Color3.fromRGB(6, 6, 6)}):Play()
  183.             end
  184.             parentTable.main:TweenSize(#parentTable.options > 0 and parentTable.open and UDim2.new(0, 230, 0, layout.AbsoluteContentSize.Y + size) or UDim2.new(0, 230, 0, size), "Out", "Quad", 0.2, true)
  185.         end
  186.     end)
  187.  
  188.     function parentTable:SetTitle(newTitle)
  189.         title.Text = tostring(newTitle)
  190.     end
  191.    
  192.     return parentTable
  193. end
  194.    
  195. local function createLabel(option, parent)
  196.     local main = library:Create("TextLabel", {
  197.         LayoutOrder = option.position,
  198.         Size = UDim2.new(1, 0, 0, 26),
  199.         BackgroundTransparency = 1,
  200.         Text = " " .. option.text,
  201.         TextSize = 17,
  202.         Font = Enum.Font.Gotham,
  203.         TextColor3 = Color3.fromRGB(255, 255, 255),
  204.         TextXAlignment = Enum.TextXAlignment.Left,
  205.         Parent = parent.content
  206.     })
  207.    
  208.     setmetatable(option, {__newindex = function(t, i, v)
  209.         if i == "Text" then
  210.             main.Text = " " .. tostring(v)
  211.         end
  212.     end})
  213. end
  214.  
  215. function createToggle(option, parent)
  216.     local main = library:Create("TextLabel", {
  217.         LayoutOrder = option.position,
  218.         Size = UDim2.new(1, 0, 0, 31),
  219.         BackgroundTransparency = 1,
  220.         Text = " " .. option.text,
  221.         TextSize = 17,
  222.         Font = Enum.Font.Gotham,
  223.         TextColor3 = Color3.fromRGB(255, 255, 255),
  224.         TextXAlignment = Enum.TextXAlignment.Left,
  225.         Parent = parent.content
  226.     })
  227.    
  228.     local tickboxOutline = library:Create("ImageLabel", {
  229.         Position = UDim2.new(1, -6, 0, 4),
  230.         Size = UDim2.new(-1, 10, 1, -10),
  231.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  232.         BackgroundTransparency = 1,
  233.         Image = "rbxassetid://3570695787",
  234.         ImageColor3 = option.state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(100, 100, 100),
  235.         ScaleType = Enum.ScaleType.Slice,
  236.         SliceCenter = Rect.new(100, 100, 100, 100),
  237.         SliceScale = 0.02,
  238.         Parent = main
  239.     })
  240.    
  241.     local tickboxInner = library:Create("ImageLabel", {
  242.         Position = UDim2.new(0, 2, 0, 2),
  243.         Size = UDim2.new(1, -4, 1, -4),
  244.         BackgroundTransparency = 1,
  245.         Image = "rbxassetid://3570695787",
  246.         ImageColor3 = option.state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(20, 20, 20),
  247.         ScaleType = Enum.ScaleType.Slice,
  248.         SliceCenter = Rect.new(100, 100, 100, 100),
  249.         SliceScale = 0.02,
  250.         Parent = tickboxOutline
  251.     })
  252.    
  253.     local checkmarkHolder = library:Create("Frame", {
  254.         Position = UDim2.new(0, 4, 0, 4),
  255.         Size = option.state and UDim2.new(1, -8, 1, -8) or UDim2.new(0, 0, 1, -8),
  256.         BackgroundTransparency = 1,
  257.         ClipsDescendants = true,
  258.         Parent = tickboxOutline
  259.     })
  260.    
  261.     local checkmark = library:Create("ImageLabel", {
  262.         Size = UDim2.new(1, 0, 1, 0),
  263.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  264.         BackgroundTransparency = 1,
  265.         Image = "rbxassetid://4919148038",
  266.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  267.         Parent = checkmarkHolder
  268.     })
  269.    
  270.     local inContact
  271.     main.InputBegan:connect(function(input)
  272.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  273.             option:SetState(not option.state)
  274.         end
  275.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  276.             inContact = true
  277.             if not option.state then
  278.                 tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
  279.             end
  280.         end
  281.     end)
  282.    
  283.     main.InputEnded:connect(function(input)
  284.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  285.             inContact = true
  286.             if not option.state then
  287.                 tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  288.             end
  289.         end
  290.     end)
  291.    
  292.     function option:SetState(state)
  293.         library.flags[self.flag] = state
  294.         self.state = state
  295.         checkmarkHolder:TweenSize(option.state and UDim2.new(1, -8, 1, -8) or UDim2.new(0, 0, 1, -8), "Out", "Quad", 0.2, true)
  296.         tweenService:Create(tickboxInner, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(20, 20, 20)}):Play()
  297.         if state then
  298.             tweenService:Create(tickboxOutline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  299.         else
  300.             if inContact then
  301.                 tweenService:Create(tickboxOutline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
  302.             else
  303.                 tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  304.             end
  305.         end
  306.         self.callback(state)
  307.     end
  308.  
  309.     if option.state then
  310.         delay(1, function() option.callback(true) end)
  311.     end
  312.    
  313.     setmetatable(option, {__newindex = function(t, i, v)
  314.         if i == "Text" then
  315.             main.Text = " " .. tostring(v)
  316.         end
  317.     end})
  318. end
  319.  
  320. function createButton(option, parent)
  321.     local main = library:Create("TextLabel", {
  322.         ZIndex = 2,
  323.         LayoutOrder = option.position,
  324.         Size = UDim2.new(1, 0, 0, 34),
  325.         BackgroundTransparency = 1,
  326.         Text = " " .. option.text,
  327.         TextSize = 17,
  328.         Font = Enum.Font.Gotham,
  329.         TextColor3 = Color3.fromRGB(255, 255, 255),
  330.         Parent = parent.content
  331.     })
  332.    
  333.     local round = library:Create("ImageLabel", {
  334.         AnchorPoint = Vector2.new(0.5, 0.5),
  335.         Position = UDim2.new(0.5, 0, 0.5, 0),
  336.         Size = UDim2.new(1, -12, 1, -10),
  337.         BackgroundTransparency = 1,
  338.         Image = "rbxassetid://3570695787",
  339.         ImageColor3 = Color3.fromRGB(40, 40, 40),
  340.         ScaleType = Enum.ScaleType.Slice,
  341.         SliceCenter = Rect.new(100, 100, 100, 100),
  342.         SliceScale = 0.02,
  343.         Parent = main
  344.     })
  345.    
  346.     local inContact
  347.     local clicking
  348.     main.InputBegan:connect(function(input)
  349.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  350.             library.flags[option.flag] = true
  351.             clicking = true
  352.             tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  353.             option.callback()
  354.         end
  355.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  356.             inContact = true
  357.             tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  358.         end
  359.     end)
  360.    
  361.     main.InputEnded:connect(function(input)
  362.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  363.             clicking = false
  364.             if inContact then
  365.                 tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  366.             else
  367.                 tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  368.             end
  369.         end
  370.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  371.             inContact = false
  372.             if not clicking then
  373.                 tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  374.             end
  375.         end
  376.     end)
  377. end
  378.  
  379. local function createBind(option, parent)
  380.     local binding
  381.     local holding
  382.     local loop
  383.     local text = string.match(option.key, "Mouse") and string.sub(option.key, 1, 5) .. string.sub(option.key, 12, 13) or option.key
  384.  
  385.     local main = library:Create("TextLabel", {
  386.         LayoutOrder = option.position,
  387.         Size = UDim2.new(1, 0, 0, 33),
  388.         BackgroundTransparency = 1,
  389.         Text = " " .. option.text,
  390.         TextSize = 17,
  391.         Font = Enum.Font.Gotham,
  392.         TextColor3 = Color3.fromRGB(255, 255, 255),
  393.         TextXAlignment = Enum.TextXAlignment.Left,
  394.         Parent = parent.content
  395.     })
  396.    
  397.     local round = library:Create("ImageLabel", {
  398.         Position = UDim2.new(1, -6, 0, 4),
  399.         Size = UDim2.new(0, -textService:GetTextSize(text, 16, Enum.Font.Gotham, Vector2.new(9e9, 9e9)).X - 16, 1, -10),
  400.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  401.         BackgroundTransparency = 1,
  402.         Image = "rbxassetid://3570695787",
  403.         ImageColor3 = Color3.fromRGB(40, 40, 40),
  404.         ScaleType = Enum.ScaleType.Slice,
  405.         SliceCenter = Rect.new(100, 100, 100, 100),
  406.         SliceScale = 0.02,
  407.         Parent = main
  408.     })
  409.    
  410.     local bindinput = library:Create("TextLabel", {
  411.         Size = UDim2.new(1, 0, 1, 0),
  412.         BackgroundTransparency = 1,
  413.         Text = text,
  414.         TextSize = 16,
  415.         Font = Enum.Font.Gotham,
  416.         TextColor3 = Color3.fromRGB(255, 255, 255),
  417.         Parent = round
  418.     })
  419.    
  420.     local inContact
  421.     main.InputBegan:connect(function(input)
  422.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  423.             inContact = true
  424.             if not binding then
  425.                 tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  426.             end
  427.         end
  428.     end)
  429.      
  430.     main.InputEnded:connect(function(input)
  431.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  432.             binding = true
  433.             bindinput.Text = "..."
  434.             tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  435.         end
  436.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  437.             inContact = false
  438.             if not binding then
  439.                 tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  440.             end
  441.         end
  442.     end)
  443.    
  444.     inputService.InputBegan:connect(function(input)
  445.         if inputService:GetFocusedTextBox() then return end
  446.         if (input.KeyCode.Name == option.key or input.UserInputType.Name == option.key) and not binding then
  447.             if option.hold then
  448.                 loop = runService.Heartbeat:connect(function()
  449.                     if binding then
  450.                         option.callback(true)
  451.                         loop:Disconnect()
  452.                         loop = nil
  453.                     else
  454.                         option.callback()
  455.                     end
  456.                 end)
  457.             else
  458.                 option.callback()
  459.             end
  460.         elseif binding then
  461.             local key
  462.             pcall(function()
  463.                 if not keyCheck(input.KeyCode, blacklistedKeys) then
  464.                     key = input.KeyCode
  465.                 end
  466.             end)
  467.             pcall(function()
  468.                 if keyCheck(input.UserInputType, whitelistedMouseinputs) and not key then
  469.                     key = input.UserInputType
  470.                 end
  471.             end)
  472.             key = key or option.key
  473.             option:SetKey(key)
  474.         end
  475.     end)
  476.    
  477.     inputService.InputEnded:connect(function(input)
  478.         if input.KeyCode.Name == option.key or input.UserInputType.Name == option.key or input.UserInputType.Name == "MouseMovement" then
  479.             if loop then
  480.                 loop:Disconnect()
  481.                 loop = nil
  482.                 option.callback(true)
  483.             end
  484.         end
  485.     end)
  486.    
  487.     function option:SetKey(key)
  488.         binding = false
  489.         if loop then
  490.             loop:Disconnect()
  491.             loop = nil
  492.         end
  493.         self.key = key or self.key
  494.         self.key = self.key.Name or self.key
  495.         library.flags[self.flag] = self.key
  496.         if string.match(self.key, "Mouse") then
  497.             bindinput.Text = string.sub(self.key, 1, 5) .. string.sub(self.key, 12, 13)
  498.         else
  499.             bindinput.Text = self.key
  500.         end
  501.         tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = inContact and Color3.fromRGB(60, 60, 60) or Color3.fromRGB(40, 40, 40)}):Play()
  502.         round.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 15, Enum.Font.Gotham, Vector2.new(9e9, 9e9)).X - 16, 1, -10)
  503.     end
  504. end
  505.  
  506. local function createSlider(option, parent)
  507.     local main = library:Create("Frame", {
  508.         LayoutOrder = option.position,
  509.         Size = UDim2.new(1, 0, 0, 50),
  510.         BackgroundTransparency = 1,
  511.         Parent = parent.content
  512.     })
  513.    
  514.     local title = library:Create("TextLabel", {
  515.         Position = UDim2.new(0, 0, 0, 4),
  516.         Size = UDim2.new(1, 0, 0, 20),
  517.         BackgroundTransparency = 1,
  518.         Text = " " .. option.text,
  519.         TextSize = 17,
  520.         Font = Enum.Font.Gotham,
  521.         TextColor3 = Color3.fromRGB(255, 255, 255),
  522.         TextXAlignment = Enum.TextXAlignment.Left,
  523.         Parent = main
  524.     })
  525.    
  526.     local slider = library:Create("ImageLabel", {
  527.         Position = UDim2.new(0, 10, 0, 34),
  528.         Size = UDim2.new(1, -20, 0, 5),
  529.         BackgroundTransparency = 1,
  530.         Image = "rbxassetid://3570695787",
  531.         ImageColor3 = Color3.fromRGB(30, 30, 30),
  532.         ScaleType = Enum.ScaleType.Slice,
  533.         SliceCenter = Rect.new(100, 100, 100, 100),
  534.         SliceScale = 0.02,
  535.         Parent = main
  536.     })
  537.    
  538.     local fill = library:Create("ImageLabel", {
  539.         BackgroundTransparency = 1,
  540.         Image = "rbxassetid://3570695787",
  541.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  542.         ScaleType = Enum.ScaleType.Slice,
  543.         SliceCenter = Rect.new(100, 100, 100, 100),
  544.         SliceScale = 0.02,
  545.         Parent = slider
  546.     })
  547.    
  548.     local circle = library:Create("ImageLabel", {
  549.         AnchorPoint = Vector2.new(0.5, 0.5),
  550.         Position = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 0.5, 0),
  551.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  552.         BackgroundTransparency = 1,
  553.         Image = "rbxassetid://3570695787",
  554.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  555.         ScaleType = Enum.ScaleType.Slice,
  556.         SliceCenter = Rect.new(100, 100, 100, 100),
  557.         SliceScale = 1,
  558.         Parent = slider
  559.     })
  560.    
  561.     local valueRound = library:Create("ImageLabel", {
  562.         Position = UDim2.new(1, -6, 0, 4),
  563.         Size = UDim2.new(0, -60, 0, 18),
  564.         BackgroundTransparency = 1,
  565.         Image = "rbxassetid://3570695787",
  566.         ImageColor3 = Color3.fromRGB(40, 40, 40),
  567.         ScaleType = Enum.ScaleType.Slice,
  568.         SliceCenter = Rect.new(100, 100, 100, 100),
  569.         SliceScale = 0.02,
  570.         Parent = main
  571.     })
  572.    
  573.     local inputvalue = library:Create("TextBox", {
  574.         Size = UDim2.new(1, 0, 1, 0),
  575.         BackgroundTransparency = 1,
  576.         Text = option.value,
  577.         TextColor3 = Color3.fromRGB(235, 235, 235),
  578.         TextSize = 15,
  579.         TextWrapped = true,
  580.         Font = Enum.Font.Gotham,
  581.         Parent = valueRound
  582.     })
  583.    
  584.     if option.min >= 0 then
  585.         fill.Size = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 1, 0)
  586.     else
  587.         fill.Position = UDim2.new((0 - option.min) / (option.max - option.min), 0, 0, 0)
  588.         fill.Size = UDim2.new(option.value / (option.max - option.min), 0, 1, 0)
  589.     end
  590.    
  591.     local sliding
  592.     local inContact
  593.     main.InputBegan:connect(function(input)
  594.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  595.             tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  596.             tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(3.5, 0, 3.5, 0), ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  597.             sliding = true
  598.             option:SetValue(option.min + ((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X) * (option.max - option.min))
  599.         end
  600.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  601.             inContact = true
  602.             if not sliding then
  603.                 tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  604.                 tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(2.8, 0, 2.8, 0), ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  605.             end
  606.         end
  607.     end)
  608.    
  609.     inputService.InputChanged:connect(function(input)
  610.         if input.UserInputType == Enum.UserInputType.MouseMovement and sliding then
  611.             option:SetValue(option.min + ((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X) * (option.max - option.min))
  612.         end
  613.     end)
  614.  
  615.     main.InputEnded:connect(function(input)
  616.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  617.             sliding = false
  618.             if inContact then
  619.                 tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  620.                 tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(2.8, 0, 2.8, 0), ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  621.             else
  622.                 tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  623.                 tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  624.             end
  625.         end
  626.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  627.             inContact = false
  628.             inputvalue:ReleaseFocus()
  629.             if not sliding then
  630.                 tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  631.                 tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  632.             end
  633.         end
  634.     end)
  635.  
  636.     inputvalue.FocusLost:connect(function()
  637.         tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  638.         option:SetValue(tonumber(inputvalue.Text) or option.value)
  639.     end)
  640.  
  641.     function option:SetValue(value)
  642.         value = round(value, option.float)
  643.         value = math.clamp(value, self.min, self.max)
  644.         circle:TweenPosition(UDim2.new((value - self.min) / (self.max - self.min), 0, 0.5, 0), "Out", "Quad", 0.1, true)
  645.         if self.min >= 0 then
  646.             fill:TweenSize(UDim2.new((value - self.min) / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
  647.         else
  648.             fill:TweenPosition(UDim2.new((0 - self.min) / (self.max - self.min), 0, 0, 0), "Out", "Quad", 0.1, true)
  649.             fill:TweenSize(UDim2.new(value / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
  650.         end
  651.         library.flags[self.flag] = value
  652.         self.value = value
  653.         inputvalue.Text = value
  654.         self.callback(value)
  655.     end
  656. end
  657.  
  658. local function createList(option, parent, holder)
  659.     local valueCount = 0
  660.    
  661.     local main = library:Create("Frame", {
  662.         LayoutOrder = option.position,
  663.         Size = UDim2.new(1, 0, 0, 52),
  664.         BackgroundTransparency = 1,
  665.         Parent = parent.content
  666.     })
  667.    
  668.     local round = library:Create("ImageLabel", {
  669.         Position = UDim2.new(0, 6, 0, 4),
  670.         Size = UDim2.new(1, -12, 1, -10),
  671.         BackgroundTransparency = 1,
  672.         Image = "rbxassetid://3570695787",
  673.         ImageColor3 = Color3.fromRGB(40, 40, 40),
  674.         ScaleType = Enum.ScaleType.Slice,
  675.         SliceCenter = Rect.new(100, 100, 100, 100),
  676.         SliceScale = 0.02,
  677.         Parent = main
  678.     })
  679.    
  680.     local title = library:Create("TextLabel", {
  681.         Position = UDim2.new(0, 12, 0, 8),
  682.         Size = UDim2.new(1, -24, 0, 14),
  683.         BackgroundTransparency = 1,
  684.         Text = option.text,
  685.         TextSize = 14,
  686.         Font = Enum.Font.GothamBold,
  687.         TextColor3 = Color3.fromRGB(140, 140, 140),
  688.         TextXAlignment = Enum.TextXAlignment.Left,
  689.         Parent = main
  690.     })
  691.    
  692.     local listvalue = library:Create("TextLabel", {
  693.         Position = UDim2.new(0, 12, 0, 20),
  694.         Size = UDim2.new(1, -24, 0, 24),
  695.         BackgroundTransparency = 1,
  696.         Text = option.value,
  697.         TextSize = 18,
  698.         Font = Enum.Font.Gotham,
  699.         TextColor3 = Color3.fromRGB(255, 255, 255),
  700.         TextXAlignment = Enum.TextXAlignment.Left,
  701.         Parent = main
  702.     })
  703.    
  704.     library:Create("ImageLabel", {
  705.         Position = UDim2.new(1, -16, 0, 16),
  706.         Size = UDim2.new(-1, 32, 1, -32),
  707.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  708.         Rotation = 90,
  709.         BackgroundTransparency = 1,
  710.         Image = "rbxassetid://4918373417",
  711.         ImageColor3 = Color3.fromRGB(140, 140, 140),
  712.         ScaleType = Enum.ScaleType.Fit,
  713.         Parent = round
  714.     })
  715.    
  716.     option.mainHolder = library:Create("ImageButton", {
  717.         ZIndex = 3,
  718.         Size = UDim2.new(0, 240, 0, 52),
  719.         BackgroundTransparency = 1,
  720.         Image = "rbxassetid://3570695787",
  721.         ImageTransparency = 1,
  722.         ImageColor3 = Color3.fromRGB(30, 30, 30),
  723.         ScaleType = Enum.ScaleType.Slice,
  724.         SliceCenter = Rect.new(100, 100, 100, 100),
  725.         SliceScale = 0.02,
  726.         Visible = false,
  727.         Parent = library.base
  728.     })
  729.    
  730.     local content = library:Create("ScrollingFrame", {
  731.         ZIndex = 3,
  732.         Size = UDim2.new(1, 0, 1, 0),
  733.         BackgroundTransparency = 1,
  734.         BorderSizePixel = 0,
  735.         ScrollBarImageColor3 = Color3.fromRGB(),
  736.         ScrollBarThickness = 0,
  737.         ScrollingDirection = Enum.ScrollingDirection.Y,
  738.         Parent = option.mainHolder
  739.     })
  740.    
  741.     library:Create("UIPadding", {
  742.         PaddingTop = UDim.new(0, 6),
  743.         Parent = content
  744.     })
  745.    
  746.     local layout = library:Create("UIListLayout", {
  747.         Parent = content
  748.     })
  749.    
  750.     layout.Changed:connect(function()
  751.         option.mainHolder.Size = UDim2.new(0, 240, 0, (valueCount > 4 and (4 * 40) or layout.AbsoluteContentSize.Y) + 12)
  752.         content.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 12)
  753.     end)
  754.    
  755.     local inContact
  756.     round.InputBegan:connect(function(input)
  757.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  758.             if library.activePopup then
  759.                 library.activePopup:Close()
  760.             end
  761.             local position = main.AbsolutePosition
  762.             option.mainHolder.Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)
  763.             option.open = true
  764.             option.mainHolder.Visible = true
  765.             library.activePopup = option
  766.             content.ScrollBarThickness = 6
  767.             tweenService:Create(option.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {ImageTransparency = 0, Position = UDim2.new(0, position.X - 5, 0, position.Y - 4)}):Play()
  768.             tweenService:Create(option.mainHolder, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0.1), {Position = UDim2.new(0, position.X - 5, 0, position.Y + 1)}):Play()
  769.             for _,label in next, content:GetChildren() do
  770.                 if label:IsA"TextLabel" then
  771.                     tweenService:Create(label, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0, TextTransparency = 0}):Play()
  772.                 end
  773.             end
  774.         end
  775.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  776.             inContact = true
  777.             if not option.open then
  778.                 tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  779.             end
  780.         end
  781.     end)
  782.    
  783.     round.InputEnded:connect(function(input)
  784.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  785.             inContact = false
  786.             if not option.open then
  787.                 tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  788.             end
  789.         end
  790.     end)
  791.    
  792.     function option:AddValue(value)
  793.         valueCount = valueCount + 1
  794.         local label = library:Create("TextLabel", {
  795.             ZIndex = 3,
  796.             Size = UDim2.new(1, 0, 0, 40),
  797.             BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  798.             BorderSizePixel = 0,
  799.             Text = "    " .. value,
  800.             TextSize = 14,
  801.             TextTransparency = self.open and 0 or 1,
  802.             Font = Enum.Font.Gotham,
  803.             TextColor3 = Color3.fromRGB(255, 255, 255),
  804.             TextXAlignment = Enum.TextXAlignment.Left,
  805.             Parent = content
  806.         })
  807.        
  808.         local inContact
  809.         local clicking
  810.         label.InputBegan:connect(function(input)
  811.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  812.                 clicking = true
  813.                 tweenService:Create(label, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  814.                 self:SetValue(value)
  815.             end
  816.             if input.UserInputType == Enum.UserInputType.MouseMovement then
  817.                 inContact = true
  818.                 if not clicking then
  819.                     tweenService:Create(label, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  820.                 end
  821.             end
  822.         end)
  823.        
  824.         label.InputEnded:connect(function(input)
  825.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  826.                 clicking = false
  827.                 tweenService:Create(label, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = inContact and Color3.fromRGB(20, 20, 20) or Color3.fromRGB(30, 30, 30)}):Play()
  828.             end
  829.             if input.UserInputType == Enum.UserInputType.MouseMovement then
  830.                 inContact = false
  831.                 if not clicking then
  832.                     tweenService:Create(label, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
  833.                 end
  834.             end
  835.         end)
  836.     end
  837.  
  838.     if not table.find(option.values, option.value) then
  839.         option:AddValue(option.value)
  840.     end
  841.    
  842.     for _, value in next, option.values do
  843.         option:AddValue(tostring(value))
  844.     end
  845.    
  846.     function option:RemoveValue(value)
  847.         for _,label in next, content:GetChildren() do
  848.             if label:IsA"TextLabel" and label.Text == " " .. value then
  849.                 label:Destroy()
  850.                 valueCount = valueCount - 1
  851.                 break
  852.             end
  853.         end
  854.         if self.value == value then
  855.             self:SetValue("")
  856.         end
  857.     end
  858.    
  859.     function option:SetValue(value)
  860.         library.flags[self.flag] = tostring(value)
  861.         self.value = tostring(value)
  862.         listvalue.Text = self.value
  863.         self.callback(value)
  864.     end
  865.    
  866.     function option:Close()
  867.         library.activePopup = nil
  868.         self.open = false
  869.         content.ScrollBarThickness = 0
  870.         local position = main.AbsolutePosition
  871.         tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = inContact and Color3.fromRGB(60, 60, 60) or Color3.fromRGB(40, 40, 40)}):Play()
  872.         tweenService:Create(self.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1, Position = UDim2.new(0, position.X - 5, 0, position.Y -10)}):Play()
  873.         for _,label in next, content:GetChildren() do
  874.             if label:IsA"TextLabel" then
  875.                 tweenService:Create(label, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1, TextTransparency = 1}):Play()
  876.             end
  877.         end
  878.         wait(0.3)
  879.         --delay(0.3, function()
  880.             if not self.open then
  881.                 self.mainHolder.Visible = false
  882.             end
  883.         --end)
  884.     end
  885.  
  886.     return option
  887. end
  888.  
  889. local function createBox(option, parent)
  890.     local main = library:Create("Frame", {
  891.         LayoutOrder = option.position,
  892.         Size = UDim2.new(1, 0, 0, 52),
  893.         BackgroundTransparency = 1,
  894.         Parent = parent.content
  895.     })
  896.    
  897.     local outline = library:Create("ImageLabel", {
  898.         Position = UDim2.new(0, 6, 0, 4),
  899.         Size = UDim2.new(1, -12, 1, -10),
  900.         BackgroundTransparency = 1,
  901.         Image = "rbxassetid://3570695787",
  902.         ImageColor3 = Color3.fromRGB(60, 60, 60),
  903.         ScaleType = Enum.ScaleType.Slice,
  904.         SliceCenter = Rect.new(100, 100, 100, 100),
  905.         SliceScale = 0.02,
  906.         Parent = main
  907.     })
  908.    
  909.     local round = library:Create("ImageLabel", {
  910.         Position = UDim2.new(0, 8, 0, 6),
  911.         Size = UDim2.new(1, -16, 1, -14),
  912.         BackgroundTransparency = 1,
  913.         Image = "rbxassetid://3570695787",
  914.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  915.         ScaleType = Enum.ScaleType.Slice,
  916.         SliceCenter = Rect.new(100, 100, 100, 100),
  917.         SliceScale = 0.01,
  918.         Parent = main
  919.     })
  920.    
  921.     local title = library:Create("TextLabel", {
  922.         Position = UDim2.new(0, 12, 0, 8),
  923.         Size = UDim2.new(1, -24, 0, 14),
  924.         BackgroundTransparency = 1,
  925.         Text = option.text,
  926.         TextSize = 14,
  927.         Font = Enum.Font.GothamBold,
  928.         TextColor3 = Color3.fromRGB(100, 100, 100),
  929.         TextXAlignment = Enum.TextXAlignment.Left,
  930.         Parent = main
  931.     })
  932.    
  933.     local inputvalue = library:Create("TextBox", {
  934.         Position = UDim2.new(0, 12, 0, 20),
  935.         Size = UDim2.new(1, -24, 0, 24),
  936.         BackgroundTransparency = 1,
  937.         Text = option.value,
  938.         TextSize = 18,
  939.         Font = Enum.Font.Gotham,
  940.         TextColor3 = Color3.fromRGB(255, 255, 255),
  941.         TextXAlignment = Enum.TextXAlignment.Left,
  942.         TextWrapped = true,
  943.         Parent = main
  944.     })
  945.    
  946.     local inContact
  947.     local focused
  948.     main.InputBegan:connect(function(input)
  949.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  950.             if not focused then inputvalue:CaptureFocus() end
  951.         end
  952.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  953.             inContact = true
  954.             if not focused then
  955.                 tweenService:Create(outline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  956.             end
  957.         end
  958.     end)
  959.    
  960.     main.InputEnded:connect(function(input)
  961.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  962.             inContact = false
  963.             if not focused then
  964.                 tweenService:Create(outline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  965.             end
  966.         end
  967.     end)
  968.    
  969.     inputvalue.Focused:connect(function()
  970.         focused = true
  971.         tweenService:Create(outline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  972.     end)
  973.    
  974.     inputvalue.FocusLost:connect(function(enter)
  975.         focused = false
  976.         tweenService:Create(outline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  977.         option:SetValue(inputvalue.Text, enter)
  978.     end)
  979.    
  980.     function option:SetValue(value, enter)
  981.         library.flags[self.flag] = tostring(value)
  982.         self.value = tostring(value)
  983.         inputvalue.Text = self.value
  984.         self.callback(value, enter)
  985.     end
  986. end
  987.  
  988. local function createColorPickerWindow(option)
  989.     option.mainHolder = library:Create("ImageButton", {
  990.         ZIndex = 3,
  991.         Size = UDim2.new(0, 240, 0, 180),
  992.         BackgroundTransparency = 1,
  993.         Image = "rbxassetid://3570695787",
  994.         ImageTransparency = 1,
  995.         ImageColor3 = Color3.fromRGB(30, 30, 30),
  996.         ScaleType = Enum.ScaleType.Slice,
  997.         SliceCenter = Rect.new(100, 100, 100, 100),
  998.         SliceScale = 0.02,
  999.         Parent = library.base
  1000.     })
  1001.        
  1002.     local hue, sat, val = Color3.toHSV(option.color)
  1003.     hue, sat, val = hue == 0 and 1 or hue, sat + 0.005, val - 0.005
  1004.     local editinghue
  1005.     local editingsatval
  1006.     local currentColor = option.color
  1007.     local previousColors = {[1] = option.color}
  1008.     local originalColor = option.color
  1009.     local rainbowEnabled
  1010.     local rainbowLoop
  1011.    
  1012.     function option:updateVisuals(Color)
  1013.         currentColor = Color
  1014.         self.visualize2.ImageColor3 = Color
  1015.         hue, sat, val = Color3.toHSV(Color)
  1016.         hue = hue == 0 and 1 or hue
  1017.         self.satval.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  1018.         self.hueSlider.Position = UDim2.new(1 - hue, 0, 0, 0)
  1019.         self.satvalSlider.Position = UDim2.new(sat, 0, 1 - val, 0)
  1020.     end
  1021.    
  1022.     option.hue = library:Create("ImageLabel", {
  1023.         ZIndex = 3,
  1024.         AnchorPoint = Vector2.new(0, 1),
  1025.         Position = UDim2.new(0, 8, 1, -8),
  1026.         Size = UDim2.new(1, -100, 0, 22),
  1027.         BackgroundTransparency = 1,
  1028.         Image = "rbxassetid://3570695787",
  1029.         ImageTransparency = 1,
  1030.         ScaleType = Enum.ScaleType.Slice,
  1031.         SliceCenter = Rect.new(100, 100, 100, 100),
  1032.         SliceScale = 0.02,
  1033.         Parent = option.mainHolder
  1034.     })
  1035.    
  1036.     local Gradient = library:Create("UIGradient", {
  1037.         Color = ColorSequence.new({
  1038.             ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
  1039.             ColorSequenceKeypoint.new(0.157, Color3.fromRGB(255, 0, 255)),
  1040.             ColorSequenceKeypoint.new(0.323, Color3.fromRGB(0, 0, 255)),
  1041.             ColorSequenceKeypoint.new(0.488, Color3.fromRGB(0, 255, 255)),
  1042.             ColorSequenceKeypoint.new(0.66, Color3.fromRGB(0, 255, 0)),
  1043.             ColorSequenceKeypoint.new(0.817, Color3.fromRGB(255, 255, 0)),
  1044.             ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0)),
  1045.         }),
  1046.         Parent = option.hue
  1047.     })
  1048.    
  1049.     option.hueSlider = library:Create("Frame", {
  1050.         ZIndex = 3,
  1051.         Position = UDim2.new(1 - hue, 0, 0, 0),
  1052.         Size = UDim2.new(0, 2, 1, 0),
  1053.         BackgroundTransparency = 1,
  1054.         BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  1055.         BorderColor3 = Color3.fromRGB(255, 255, 255),
  1056.         Parent = option.hue
  1057.     })
  1058.    
  1059.     option.hue.InputBegan:connect(function(Input)
  1060.         if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1061.             editinghue = true
  1062.             X = (option.hue.AbsolutePosition.X + option.hue.AbsoluteSize.X) - option.hue.AbsolutePosition.X
  1063.             X = (Input.Position.X - option.hue.AbsolutePosition.X) / X
  1064.             X = X < 0 and 0 or X > 0.995 and 0.995 or X
  1065.             option:updateVisuals(Color3.fromHSV(1 - X, sat, val))
  1066.         end
  1067.     end)
  1068.    
  1069.     inputService.InputChanged:connect(function(Input)
  1070.         if Input.UserInputType == Enum.UserInputType.MouseMovement and editinghue then
  1071.             X = (option.hue.AbsolutePosition.X + option.hue.AbsoluteSize.X) - option.hue.AbsolutePosition.X
  1072.             X = (Input.Position.X - option.hue.AbsolutePosition.X) / X
  1073.             X = X <= 0 and 0 or X >= 0.995 and 0.995 or X
  1074.             option:updateVisuals(Color3.fromHSV(1 - X, sat, val))
  1075.         end
  1076.     end)
  1077.    
  1078.     option.hue.InputEnded:connect(function(Input)
  1079.         if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1080.             editinghue = false
  1081.         end
  1082.     end)
  1083.    
  1084.     option.satval = library:Create("ImageLabel", {
  1085.         ZIndex = 3,
  1086.         Position = UDim2.new(0, 8, 0, 8),
  1087.         Size = UDim2.new(1, -100, 1, -42),
  1088.         BackgroundTransparency = 1,
  1089.         BackgroundColor3 = Color3.fromHSV(hue, 1, 1),
  1090.         BorderSizePixel = 0,
  1091.         Image = "rbxassetid://4155801252",
  1092.         ImageTransparency = 1,
  1093.         ClipsDescendants = true,
  1094.         Parent = option.mainHolder
  1095.     })
  1096.    
  1097.     option.satvalSlider = library:Create("Frame", {
  1098.         ZIndex = 3,
  1099.         AnchorPoint = Vector2.new(0.5, 0.5),
  1100.         Position = UDim2.new(sat, 0, 1 - val, 0),
  1101.         Size = UDim2.new(0, 4, 0, 4),
  1102.         Rotation = 45,
  1103.         BackgroundTransparency = 1,
  1104.         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1105.         Parent = option.satval
  1106.     })
  1107.    
  1108.     option.satval.InputBegan:connect(function(Input)
  1109.         if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1110.             editingsatval = true
  1111.             X = (option.satval.AbsolutePosition.X + option.satval.AbsoluteSize.X) - option.satval.AbsolutePosition.X
  1112.             Y = (option.satval.AbsolutePosition.Y + option.satval.AbsoluteSize.Y) - option.satval.AbsolutePosition.Y
  1113.             X = (Input.Position.X - option.satval.AbsolutePosition.X) / X
  1114.             Y = (Input.Position.Y - option.satval.AbsolutePosition.Y) / Y
  1115.             X = X <= 0.005 and 0.005 or X >= 1 and 1 or X
  1116.             Y = Y <= 0 and 0 or Y >= 0.995 and 0.995 or Y
  1117.             option:updateVisuals(Color3.fromHSV(hue, X, 1 - Y))
  1118.         end
  1119.     end)
  1120.    
  1121.     inputService.InputChanged:connect(function(Input)
  1122.         if Input.UserInputType == Enum.UserInputType.MouseMovement and editingsatval then
  1123.             X = (option.satval.AbsolutePosition.X + option.satval.AbsoluteSize.X) - option.satval.AbsolutePosition.X
  1124.             Y = (option.satval.AbsolutePosition.Y + option.satval.AbsoluteSize.Y) - option.satval.AbsolutePosition.Y
  1125.             X = (Input.Position.X - option.satval.AbsolutePosition.X) / X
  1126.             Y = (Input.Position.Y - option.satval.AbsolutePosition.Y) / Y
  1127.             X = X <= 0.005 and 0.005 or X >= 1 and 1 or X
  1128.             Y = Y <= 0 and 0 or Y >= 0.995 and 0.995 or Y
  1129.             option:updateVisuals(Color3.fromHSV(hue, X, 1 - Y))
  1130.         end
  1131.     end)
  1132.    
  1133.     option.satval.InputEnded:connect(function(Input)
  1134.         if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1135.             editingsatval = false
  1136.         end
  1137.     end)
  1138.    
  1139.     option.visualize2 = library:Create("ImageLabel", {
  1140.         ZIndex = 3,
  1141.         Position = UDim2.new(1, -8, 0, 8),
  1142.         Size = UDim2.new(0, -80, 0, 80),
  1143.         BackgroundTransparency = 1,
  1144.         Image = "rbxassetid://3570695787",
  1145.         ImageColor3 = currentColor,
  1146.         ScaleType = Enum.ScaleType.Slice,
  1147.         SliceCenter = Rect.new(100, 100, 100, 100),
  1148.         SliceScale = 0.02,
  1149.         Parent = option.mainHolder
  1150.     })
  1151.    
  1152.     option.resetColor = library:Create("ImageLabel", {
  1153.         ZIndex = 3,
  1154.         Position = UDim2.new(1, -8, 0, 92),
  1155.         Size = UDim2.new(0, -80, 0, 18),
  1156.         BackgroundTransparency = 1,
  1157.         Image = "rbxassetid://3570695787",
  1158.         ImageTransparency = 1,
  1159.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  1160.         ScaleType = Enum.ScaleType.Slice,
  1161.         SliceCenter = Rect.new(100, 100, 100, 100),
  1162.         SliceScale = 0.02,
  1163.         Parent = option.mainHolder
  1164.     })
  1165.    
  1166.     option.resetText = library:Create("TextLabel", {
  1167.         ZIndex = 3,
  1168.         Size = UDim2.new(1, 0, 1, 0),
  1169.         BackgroundTransparency = 1,
  1170.         Text = "Reset",
  1171.         TextTransparency = 1,
  1172.         Font = Enum.Font.Code,
  1173.         TextSize = 15,
  1174.         TextColor3 = Color3.fromRGB(255, 255, 255),
  1175.         Parent = option.resetColor
  1176.     })
  1177.    
  1178.     option.resetColor.InputBegan:connect(function(Input)
  1179.         if Input.UserInputType == Enum.UserInputType.MouseButton1 and not rainbowEnabled then
  1180.             previousColors = {originalColor}
  1181.             option:SetColor(originalColor)
  1182.         end
  1183.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1184.             tweenService:Create(option.resetColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1185.         end
  1186.     end)
  1187.    
  1188.     option.resetColor.InputEnded:connect(function(Input)
  1189.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1190.             tweenService:Create(option.resetColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1191.         end
  1192.     end)
  1193.    
  1194.     option.undoColor = library:Create("ImageLabel", {
  1195.         ZIndex = 3,
  1196.         Position = UDim2.new(1, -8, 0, 112),
  1197.         Size = UDim2.new(0, -80, 0, 18),
  1198.         BackgroundTransparency = 1,
  1199.         Image = "rbxassetid://3570695787",
  1200.         ImageTransparency = 1,
  1201.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  1202.         ScaleType = Enum.ScaleType.Slice,
  1203.         SliceCenter = Rect.new(100, 100, 100, 100),
  1204.         SliceScale = 0.02,
  1205.         Parent = option.mainHolder
  1206.     })
  1207.    
  1208.     option.undoText = library:Create("TextLabel", {
  1209.         ZIndex = 3,
  1210.         Size = UDim2.new(1, 0, 1, 0),
  1211.         BackgroundTransparency = 1,
  1212.         Text = "Undo",
  1213.         TextTransparency = 1,
  1214.         Font = Enum.Font.Code,
  1215.         TextSize = 15,
  1216.         TextColor3 = Color3.fromRGB(255, 255, 255),
  1217.         Parent = option.undoColor
  1218.     })
  1219.    
  1220.     option.undoColor.InputBegan:connect(function(Input)
  1221.         if Input.UserInputType == Enum.UserInputType.MouseButton1 and not rainbowEnabled then
  1222.             local Num = #previousColors == 1 and 0 or 1
  1223.             option:SetColor(previousColors[#previousColors - Num])
  1224.             if #previousColors ~= 1 then
  1225.                 table.remove(previousColors, #previousColors)
  1226.             end
  1227.         end
  1228.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1229.             tweenService:Create(option.undoColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1230.         end
  1231.     end)
  1232.    
  1233.     option.undoColor.InputEnded:connect(function(Input)
  1234.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1235.             tweenService:Create(option.undoColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1236.         end
  1237.     end)
  1238.    
  1239.     option.setColor = library:Create("ImageLabel", {
  1240.         ZIndex = 3,
  1241.         Position = UDim2.new(1, -8, 0, 132),
  1242.         Size = UDim2.new(0, -80, 0, 18),
  1243.         BackgroundTransparency = 1,
  1244.         Image = "rbxassetid://3570695787",
  1245.         ImageTransparency = 1,
  1246.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  1247.         ScaleType = Enum.ScaleType.Slice,
  1248.         SliceCenter = Rect.new(100, 100, 100, 100),
  1249.         SliceScale = 0.02,
  1250.         Parent = option.mainHolder
  1251.     })
  1252.    
  1253.     option.setText = library:Create("TextLabel", {
  1254.         ZIndex = 3,
  1255.         Size = UDim2.new(1, 0, 1, 0),
  1256.         BackgroundTransparency = 1,
  1257.         Text = "Set",
  1258.         TextTransparency = 1,
  1259.         Font = Enum.Font.Code,
  1260.         TextSize = 15,
  1261.         TextColor3 = Color3.fromRGB(255, 255, 255),
  1262.         Parent = option.setColor
  1263.     })
  1264.    
  1265.     option.setColor.InputBegan:connect(function(Input)
  1266.         if Input.UserInputType == Enum.UserInputType.MouseButton1 and not rainbowEnabled then
  1267.             table.insert(previousColors, currentColor)
  1268.             option:SetColor(currentColor)
  1269.         end
  1270.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1271.             tweenService:Create(option.setColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1272.         end
  1273.     end)
  1274.    
  1275.     option.setColor.InputEnded:connect(function(Input)
  1276.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1277.             tweenService:Create(option.setColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1278.         end
  1279.     end)
  1280.    
  1281.     option.rainbow = library:Create("ImageLabel", {
  1282.         ZIndex = 3,
  1283.         Position = UDim2.new(1, -8, 0, 152),
  1284.         Size = UDim2.new(0, -80, 0, 18),
  1285.         BackgroundTransparency = 1,
  1286.         Image = "rbxassetid://3570695787",
  1287.         ImageTransparency = 1,
  1288.         ImageColor3 = Color3.fromRGB(20, 20, 20),
  1289.         ScaleType = Enum.ScaleType.Slice,
  1290.         SliceCenter = Rect.new(100, 100, 100, 100),
  1291.         SliceScale = 0.02,
  1292.         Parent = option.mainHolder
  1293.     })
  1294.    
  1295.     option.rainbowText = library:Create("TextLabel", {
  1296.         ZIndex = 3,
  1297.         Size = UDim2.new(1, 0, 1, 0),
  1298.         BackgroundTransparency = 1,
  1299.         Text = "Rainbow",
  1300.         TextTransparency = 1,
  1301.         Font = Enum.Font.Code,
  1302.         TextSize = 15,
  1303.         TextColor3 = Color3.fromRGB(255, 255, 255),
  1304.         Parent = option.rainbow
  1305.     })
  1306.    
  1307.     option.rainbow.InputBegan:connect(function(Input)
  1308.         if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1309.             rainbowEnabled = not rainbowEnabled
  1310.             if rainbowEnabled then
  1311.                 rainbowLoop = runService.Heartbeat:connect(function()
  1312.                     option:SetColor(chromaColor)
  1313.                     option.rainbowText.TextColor3 = chromaColor
  1314.                 end)
  1315.             else
  1316.                 rainbowLoop:Disconnect()
  1317.                 option:SetColor(previousColors[#previousColors])
  1318.                 option.rainbowText.TextColor3 = Color3.fromRGB(255, 255, 255)
  1319.             end
  1320.         end
  1321.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1322.             tweenService:Create(option.rainbow, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1323.         end
  1324.     end)
  1325.    
  1326.     option.rainbow.InputEnded:connect(function(Input)
  1327.         if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1328.             tweenService:Create(option.rainbow, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1329.         end
  1330.     end)
  1331.    
  1332.     return option
  1333. end
  1334.  
  1335. local function createColor(option, parent, holder)
  1336.     option.main = library:Create("TextLabel", {
  1337.         LayoutOrder = option.position,
  1338.         Size = UDim2.new(1, 0, 0, 31),
  1339.         BackgroundTransparency = 1,
  1340.         Text = " " .. option.text,
  1341.         TextSize = 17,
  1342.         Font = Enum.Font.Gotham,
  1343.         TextColor3 = Color3.fromRGB(255, 255, 255),
  1344.         TextXAlignment = Enum.TextXAlignment.Left,
  1345.         Parent = parent.content
  1346.     })
  1347.    
  1348.     local colorBoxOutline = library:Create("ImageLabel", {
  1349.         Position = UDim2.new(1, -6, 0, 4),
  1350.         Size = UDim2.new(-1, 10, 1, -10),
  1351.         SizeConstraint = Enum.SizeConstraint.RelativeYY,
  1352.         BackgroundTransparency = 1,
  1353.         Image = "rbxassetid://3570695787",
  1354.         ImageColor3 = Color3.fromRGB(100, 100, 100),
  1355.         ScaleType = Enum.ScaleType.Slice,
  1356.         SliceCenter = Rect.new(100, 100, 100, 100),
  1357.         SliceScale = 0.02,
  1358.         Parent = option.main
  1359.     })
  1360.    
  1361.     option.visualize = library:Create("ImageLabel", {
  1362.         Position = UDim2.new(0, 2, 0, 2),
  1363.         Size = UDim2.new(1, -4, 1, -4),
  1364.         BackgroundTransparency = 1,
  1365.         Image = "rbxassetid://3570695787",
  1366.         ImageColor3 = option.color,
  1367.         ScaleType = Enum.ScaleType.Slice,
  1368.         SliceCenter = Rect.new(100, 100, 100, 100),
  1369.         SliceScale = 0.02,
  1370.         Parent = colorBoxOutline
  1371.     })
  1372.    
  1373.     local inContact
  1374.     option.main.InputBegan:connect(function(input)
  1375.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1376.             if not option.mainHolder then createColorPickerWindow(option) end
  1377.             if library.activePopup then
  1378.                 library.activePopup:Close()
  1379.             end
  1380.             local position = option.main.AbsolutePosition
  1381.             option.mainHolder.Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)
  1382.             option.open = true
  1383.             option.mainHolder.Visible = true
  1384.             library.activePopup = option
  1385.             tweenService:Create(option.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {ImageTransparency = 0, Position = UDim2.new(0, position.X - 5, 0, position.Y - 4)}):Play()
  1386.             tweenService:Create(option.mainHolder, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0.1), {Position = UDim2.new(0, position.X - 5, 0, position.Y + 1)}):Play()
  1387.             tweenService:Create(option.satval, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1388.             for _,object in next, option.mainHolder:GetDescendants() do
  1389.                 if object:IsA"TextLabel" then
  1390.                     tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  1391.                 elseif object:IsA"ImageLabel" then
  1392.                     tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  1393.                 elseif object:IsA"Frame" then
  1394.                     tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1395.                 end
  1396.             end
  1397.         end
  1398.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  1399.             inContact = true
  1400.             if not option.open then
  1401.                 tweenService:Create(colorBoxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
  1402.             end
  1403.         end
  1404.     end)
  1405.    
  1406.     option.main.InputEnded:connect(function(input)
  1407.         if input.UserInputType == Enum.UserInputType.MouseMovement then
  1408.             inContact = true
  1409.             if not option.open then
  1410.                 tweenService:Create(colorBoxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  1411.             end
  1412.         end
  1413.     end)
  1414.    
  1415.     function option:SetColor(newColor)
  1416.         if self.mainHolder then
  1417.             self:updateVisuals(newColor)
  1418.         end
  1419.         self.visualize.ImageColor3 = newColor
  1420.         library.flags[self.flag] = newColor
  1421.         self.color = newColor
  1422.         self.callback(newColor)
  1423.     end
  1424.    
  1425.     function option:Close()
  1426.         library.activePopup = nil
  1427.         self.open = false
  1428.         local position = self.main.AbsolutePosition
  1429.         tweenService:Create(self.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1, Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)}):Play()
  1430.         tweenService:Create(self.satval, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1431.         for _,object in next, self.mainHolder:GetDescendants() do
  1432.             if object:IsA"TextLabel" then
  1433.                 tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  1434.             elseif object:IsA"ImageLabel" then
  1435.                 tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  1436.             elseif object:IsA"Frame" then
  1437.                 tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1438.             end
  1439.         end
  1440.         delay(0.3, function()
  1441.             if not self.open then
  1442.                 self.mainHolder.Visible = false
  1443.             end
  1444.         end)
  1445.     end
  1446. end
  1447.  
  1448. local function createDivider(option, parent, holder)
  1449.     option.main = library:Create('Frame', {
  1450.         LayoutOrder = option.position,
  1451.         BackgroundTransparency = 1,
  1452.  
  1453.         Size = UDim2.new(1, 0, 0, 6),
  1454.         Parent = parent.content;
  1455.     })
  1456.  
  1457.     option.divider = library:Create('Frame', {
  1458.         AnchorPoint = Vector2.new(0.5, 0.5),
  1459.         Position = UDim2.fromScale(0.5, 0.5),
  1460.  
  1461.         BorderSizePixel = 0,
  1462.         BorderColor3 = Color3.fromRGB(50, 50, 50),
  1463.         BackgroundColor3 = Color3.fromRGB(50, 50, 50),
  1464.  
  1465.         Size = UDim2.new(1, -10, 0, 2),
  1466.         Parent = option.main,
  1467.     })
  1468. end
  1469.  
  1470. local function loadOptions(option, holder)
  1471.     for _,newOption in next, option.options do
  1472.         if newOption.type == "label" then
  1473.             createLabel(newOption, option)
  1474.         elseif newOption.type == "toggle" then
  1475.             createToggle(newOption, option)
  1476.         elseif newOption.type == "button" then
  1477.             createButton(newOption, option)
  1478.         elseif newOption.type == "list" then
  1479.             createList(newOption, option, holder)
  1480.         elseif newOption.type == "box" then
  1481.             createBox(newOption, option)
  1482.         elseif newOption.type == "bind" then
  1483.             createBind(newOption, option)
  1484.         elseif newOption.type == "slider" then
  1485.             createSlider(newOption, option)
  1486.         elseif newOption.type == "color" then
  1487.             createColor(newOption, option, holder)
  1488.         elseif newOption.type == 'divider' then
  1489.             createDivider(newOption, option, holder)
  1490.         elseif newOption.type == "folder" then
  1491.             newOption:init()
  1492.         end
  1493.     end
  1494. end
  1495.  
  1496. local function getFnctions(parent)
  1497.     function parent:AddLabel(option)
  1498.         option = typeof(option) == "table" and option or {}
  1499.         option.text = tostring(option.text)
  1500.         option.type = "label"
  1501.         option.position = #self.options
  1502.         table.insert(self.options, option)
  1503.        
  1504.         return option
  1505.     end
  1506.  
  1507.     function parent:AddDivider(option)
  1508.         option = type(option) == 'table' and option or {}
  1509.         option.type = 'divider'
  1510.         option.position = #self.options
  1511.         table.insert(self.options, option)
  1512.  
  1513.         return options
  1514.     end
  1515.    
  1516.     function parent:AddToggle(option)
  1517.         option = typeof(option) == "table" and option or {}
  1518.         option.text = tostring(option.text)
  1519.         option.state = typeof(option.state) == "boolean" and option.state or false
  1520.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1521.         option.type = "toggle"
  1522.         option.position = #self.options
  1523.         option.flag = option.flag or option.text
  1524.         library.flags[option.flag] = option.state
  1525.         table.insert(self.options, option)
  1526.        
  1527.         return option
  1528.     end
  1529.    
  1530.     function parent:AddButton(option)
  1531.         option = typeof(option) == "table" and option or {}
  1532.         option.text = tostring(option.text)
  1533.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1534.         option.type = "button"
  1535.         option.position = #self.options
  1536.         option.flag = option.flag or option.text
  1537.         table.insert(self.options, option)
  1538.        
  1539.         return option
  1540.     end
  1541.    
  1542.     function parent:AddBind(option)
  1543.         option = typeof(option) == "table" and option or {}
  1544.         option.text = tostring(option.text)
  1545.         option.key = (option.key and option.key.Name) or option.key or "F"
  1546.         option.hold = typeof(option.hold) == "boolean" and option.hold or false
  1547.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1548.         option.type = "bind"
  1549.         option.position = #self.options
  1550.         option.flag = option.flag or option.text
  1551.         library.flags[option.flag] = option.key
  1552.         table.insert(self.options, option)
  1553.        
  1554.         return option
  1555.     end
  1556.    
  1557.     function parent:AddSlider(option)
  1558.         option = typeof(option) == "table" and option or {}
  1559.         option.text = tostring(option.text)
  1560.         option.min = typeof(option.min) == "number" and option.min or 0
  1561.         option.max = typeof(option.max) == "number" and option.max or 0
  1562.         option.dual = typeof(option.dual) == "boolean" and option.dual or false
  1563.         option.value = math.clamp(typeof(option.value) == "number" and option.value or option.min, option.min, option.max)
  1564.         option.value2 = typeof(option.value2) == "number" and option.value2 or option.max
  1565.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1566.         option.float = typeof(option.value) == "number" and option.float or 1
  1567.         option.type = "slider"
  1568.         option.position = #self.options
  1569.         option.flag = option.flag or option.text
  1570.         library.flags[option.flag] = option.value
  1571.         table.insert(self.options, option)
  1572.        
  1573.         return option
  1574.     end
  1575.    
  1576.     function parent:AddList(option)
  1577.         option = typeof(option) == "table" and option or {}
  1578.         option.text = tostring(option.text)
  1579.         option.values = typeof(option.values) == "table" and option.values or {}
  1580.         option.value = tostring(option.value or option.values[1] or "")
  1581.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1582.         option.open = false
  1583.         option.type = "list"
  1584.         option.position = #self.options
  1585.         option.flag = option.flag or option.text
  1586.         library.flags[option.flag] = option.value
  1587.         table.insert(self.options, option)
  1588.        
  1589.         return option
  1590.     end
  1591.    
  1592.     function parent:AddBox(option)
  1593.         option = typeof(option) == "table" and option or {}
  1594.         option.text = tostring(option.text)
  1595.         option.value = tostring(option.value or "")
  1596.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1597.         option.type = "box"
  1598.         option.position = #self.options
  1599.         option.flag = option.flag or option.text
  1600.         library.flags[option.flag] = option.value
  1601.         table.insert(self.options, option)
  1602.        
  1603.         return option
  1604.     end
  1605.    
  1606.     function parent:AddColor(option)
  1607.         option = typeof(option) == "table" and option or {}
  1608.         option.text = tostring(option.text)
  1609.         option.color = typeof(option.color) == "table" and Color3.new(tonumber(option.color[1]), tonumber(option.color[2]), tonumber(option.color[3])) or option.color or Color3.new(255, 255, 255)
  1610.         option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1611.         option.open = false
  1612.         option.type = "color"
  1613.         option.position = #self.options
  1614.         option.flag = option.flag or option.text
  1615.         library.flags[option.flag] = option.color
  1616.         table.insert(self.options, option)
  1617.        
  1618.         return option
  1619.     end
  1620.    
  1621.     function parent:AddFolder(title)
  1622.         local option = {}
  1623.         option.title = tostring(title)
  1624.         option.options = {}
  1625.         option.open = false
  1626.         option.type = "folder"
  1627.         option.position = #self.options
  1628.         table.insert(self.options, option)
  1629.        
  1630.         getFnctions(option)
  1631.        
  1632.         function option:init()
  1633.             createOptionHolder(self.title, parent.content, self, true)
  1634.             loadOptions(self, parent)
  1635.         end
  1636.        
  1637.         return option
  1638.     end
  1639. end
  1640.  
  1641. function library:CreateWindow(title)
  1642.     local window = {title = tostring(title), options = {}, open = true, canInit = true, init = false, position = #self.windows}
  1643.     getFnctions(window)
  1644.    
  1645.     table.insert(library.windows, window)
  1646.    
  1647.     return window
  1648. end
  1649.  
  1650. local UIToggle
  1651. local UnlockMouse
  1652. function library:Init()
  1653.    
  1654.     self.base = self.base or self:Create("ScreenGui")
  1655.     if (syn and syn.protect_gui) then
  1656.         syn.protect_gui(self.base)
  1657.         self.base.Parent = game:GetService"CoreGui"
  1658.     elseif type(get_hidden_gui) == 'function' then
  1659.         self.base.Parent = get_hidden_gui()
  1660.     elseif type(gethui) == 'function' then
  1661.         self.base.Parent = gethui()
  1662.     else
  1663.         self.base.Name = tostring(math.random())
  1664.         self.base.Parent = game:GetService"CoreGui"
  1665.     end
  1666.    
  1667.    
  1668.     self.cursor = self.cursor or self:Create("Frame", {
  1669.         ZIndex = 100,
  1670.         AnchorPoint = Vector2.new(0, 0),
  1671.         Size = UDim2.new(0, 5, 0, 5),
  1672.         BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1673.         Parent = self.base
  1674.     })
  1675.    
  1676.     for _, window in next, self.windows do
  1677.         if window.canInit and not window.init then
  1678.             window.init = true
  1679.             createOptionHolder(window.title, self.base, window)
  1680.             loadOptions(window)
  1681.         end
  1682.     end
  1683. end
  1684.  
  1685. function library:Close()
  1686.     self.open = not self.open
  1687.     self.cursor.Visible = self.open
  1688.     if self.activePopup then
  1689.         self.activePopup:Close()
  1690.     end
  1691.     for _, window in next, self.windows do
  1692.         if window.main then
  1693.             window.main.Visible = self.open
  1694.         end
  1695.     end
  1696. end
  1697.  
  1698. inputService.InputBegan:connect(function(input)
  1699.     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1700.         if library.activePopup then
  1701.             if input.Position.X < library.activePopup.mainHolder.AbsolutePosition.X or input.Position.Y < library.activePopup.mainHolder.AbsolutePosition.Y then
  1702.                 library.activePopup:Close()
  1703.             end
  1704.         end
  1705.         if library.activePopup then
  1706.             if input.Position.X > library.activePopup.mainHolder.AbsolutePosition.X + library.activePopup.mainHolder.AbsoluteSize.X or input.Position.Y > library.activePopup.mainHolder.AbsolutePosition.Y + library.activePopup.mainHolder.AbsoluteSize.Y then
  1707.                 library.activePopup:Close()
  1708.             end
  1709.         end
  1710.     end
  1711. end)
  1712.  
  1713. inputService.InputChanged:connect(function(input)
  1714.     if input.UserInputType == Enum.UserInputType.MouseMovement and library.cursor then
  1715.         local mouse = inputService:GetMouseLocation() + Vector2.new(0, -36)
  1716.         library.cursor.Position = UDim2.new(0, mouse.X - 2, 0, mouse.Y - 2)
  1717.     end
  1718.     if input == dragInput and dragging then
  1719.         update(input)
  1720.     end
  1721. end)
  1722.  
  1723. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement