Mr_3242

This isn’t a script its a Ui Library i made

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