Vortex23

Library

Aug 13th, 2024 (edited)
14,992
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 112.59 KB | None | 0 0
  1. local cloneref = cloneref or function(o) return o end
  2. local InputService: UserInputService = cloneref(game:GetService('UserInputService'));
  3. local TextService: TextService = cloneref(game:GetService('TextService'));
  4. local CoreGui: CoreGui = cloneref(game:GetService('CoreGui'));
  5. local Teams: Teams = cloneref(game:GetService('Teams'));
  6. local Players: Players = cloneref(game:GetService('Players'));
  7. local RunService: RunService = cloneref(game:GetService('RunService'));
  8. local TweenService: TweenService = cloneref(game:GetService('TweenService'));
  9. local RenderStepped = RunService.RenderStepped;
  10. local LocalPlayer = Players.LocalPlayer;
  11. local Mouse = LocalPlayer:GetMouse();
  12.  
  13. local ProtectGui = protectgui or (syn and syn.protect_gui) or (function() end);
  14. local GetHUI = gethui or (function() return CoreGui end);
  15. local IsKrampus = ((identifyexecutor or (function() return "" end))():lower() == "krampus");
  16.  
  17. pcall(function()
  18.     OldInstance:Destroy()
  19. end)
  20.  
  21. local ScreenGui = Instance.new('ScreenGui');
  22. ProtectGui(ScreenGui);
  23.  
  24. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Global;
  25. ScreenGui.Parent = GetHUI();
  26.  
  27. getgenv().OldInstance = ScreenGui
  28.  
  29. local Toggles = {};
  30. local Options = {};
  31.  
  32. getgenv().Linoria = {
  33.     Toggles = Toggles,
  34.     Options = Options
  35. }
  36.  
  37. getgenv().Toggles = Toggles; -- if you load infinite yeild after you executed any script with LinoriaLib it will just break the whole UI lib :/ (thats why I added getgenv().Linoria)
  38. getgenv().Options = Options;
  39.  
  40. local LibraryMainOuterFrame = nil;
  41. local Library = {
  42.     Registry = {};
  43.     RegistryMap = {};
  44.  
  45.     HudRegistry = {};
  46.  
  47.     FontColor = Color3.fromRGB(255, 255, 255);
  48.     MainColor = Color3.fromRGB(28, 28, 28);
  49.     BackgroundColor = Color3.fromRGB(20, 20, 20);
  50.     AccentColor = Color3.fromRGB(0, 85, 255);
  51.     OutlineColor = Color3.fromRGB(50, 50, 50);
  52.     RiskColor = Color3.fromRGB(255, 50, 50),
  53.  
  54.     Black = Color3.new(0, 0, 0);
  55.     Font = Enum.Font.Code,
  56.  
  57.     OpenedFrames = {};
  58.     DependencyBoxes = {};
  59.  
  60.     Signals = {};
  61.     ScreenGui = ScreenGui;
  62.    
  63.     ActiveTab = nil;
  64.     Toggled = false;
  65.    
  66.     MinSize = Vector2.new(550, 300);
  67.     IsMobile = false;
  68.     DevicePlatform = Enum.Platform.None;
  69.     CanDrag = true;
  70.     CantDragForced = false;
  71.     ShowCustomCursor = false;
  72.     VideoLink = "";
  73.     TotalTabs = 0;
  74. };
  75.  
  76. pcall(function() Library.DevicePlatform = InputService:GetPlatform(); end); -- For safety so the UI library doesn't error.
  77. Library.IsMobile = (Library.DevicePlatform == Enum.Platform.Android or Library.DevicePlatform == Enum.Platform.IOS);
  78.  
  79. if Library.IsMobile then
  80.     Library.MinSize = Vector2.new(550, 200); -- Make UI little bit smaller.
  81. end
  82.  
  83. local RainbowStep = 0
  84. local Hue = 0
  85.  
  86. table.insert(Library.Signals, RenderStepped:Connect(function(Delta)
  87.     RainbowStep = RainbowStep + Delta
  88.  
  89.     if RainbowStep >= (1 / 60) then
  90.         RainbowStep = 0;
  91.  
  92.         Hue = Hue + (1 / 400);
  93.  
  94.         if Hue > 1 then
  95.             Hue = 0;
  96.         end;
  97.  
  98.         Library.CurrentRainbowHue = Hue;
  99.         Library.CurrentRainbowColor = Color3.fromHSV(Hue, 0.8, 1);
  100.     end;
  101. end));
  102.  
  103. local function GetPlayersString()
  104.     local PlayerList = Players:GetPlayers();
  105.  
  106.     for i = 1, #PlayerList do
  107.         PlayerList[i] = PlayerList[i].Name;
  108.     end;
  109.  
  110.     table.sort(PlayerList, function(str1, str2) return str1 < str2 end);
  111.  
  112.     return PlayerList;
  113. end;
  114.  
  115. local function GetTeamsString()
  116.     local TeamList = Teams:GetTeams();
  117.  
  118.     for i = 1, #TeamList do
  119.         TeamList[i] = TeamList[i].Name;
  120.     end;
  121.  
  122.     table.sort(TeamList, function(str1, str2) return str1 < str2 end);
  123.    
  124.     return TeamList;
  125. end;
  126.  
  127. function Library:SafeCallback(f, ...)
  128.     if (not f) then
  129.         return;
  130.     end;
  131.  
  132.     if not Library.NotifyOnError then
  133.         return f(...);
  134.     end;
  135.  
  136.     local success, event = pcall(f, ...);
  137.  
  138.     if not success then
  139.         local _, i = event:find(":%d+: ");
  140.  
  141.         if not i then
  142.             return Library:Notify(event);
  143.         end;
  144.  
  145.         return Library:Notify(event:sub(i + 1), 3);
  146.     end;
  147. end;
  148.  
  149. function Library:AttemptSave()
  150.     if Library.SaveManager then
  151.         Library.SaveManager:Save();
  152.     end;
  153. end;
  154.  
  155. function Library:Create(Class, Properties)
  156.     local _Instance = Class;
  157.  
  158.     if type(Class) == 'string' then
  159.         _Instance = Instance.new(Class);
  160.     end;
  161.  
  162.     for Property, Value in next, Properties do
  163.         _Instance[Property] = Value;
  164.     end;
  165.  
  166.     return _Instance;
  167. end;
  168.  
  169. function Library:ApplyTextStroke(Inst)
  170.     Inst.TextStrokeTransparency = 1;
  171.  
  172.     Library:Create('UIStroke', {
  173.         Color = Color3.new(0, 0, 0);
  174.         Thickness = 1;
  175.         LineJoinMode = Enum.LineJoinMode.Miter;
  176.         Parent = Inst;
  177.     });
  178. end;
  179.  
  180. function Library:CreateLabel(Properties, IsHud)
  181.     local _Instance = Library:Create('TextLabel', {
  182.         BackgroundTransparency = 1;
  183.         Font = Library.Font;
  184.         TextColor3 = Library.FontColor;
  185.         TextSize = 16;
  186.         TextStrokeTransparency = 0;
  187.     });
  188.  
  189.     Library:ApplyTextStroke(_Instance);
  190.  
  191.     Library:AddToRegistry(_Instance, {
  192.         TextColor3 = 'FontColor';
  193.     }, IsHud);
  194.  
  195.     return Library:Create(_Instance, Properties);
  196. end;
  197.  
  198. function Library:MakeDraggable(Instance, Cutoff)
  199.     Instance.Active = true;
  200.  
  201.     Instance.InputBegan:Connect(function(Input)
  202.         if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  203.             local ObjPos = Vector2.new(
  204.                 Mouse.X - Instance.AbsolutePosition.X,
  205.                 Mouse.Y - Instance.AbsolutePosition.Y
  206.             );
  207.  
  208.             if ObjPos.Y > (Cutoff or 40) then
  209.                 return;
  210.             end;
  211.  
  212.             while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  213.                 Instance.Position = UDim2.new(
  214.                     0,
  215.                     Mouse.X - ObjPos.X + (Instance.Size.X.Offset * Instance.AnchorPoint.X),
  216.                     0,
  217.                     Mouse.Y - ObjPos.Y + (Instance.Size.Y.Offset * Instance.AnchorPoint.Y)
  218.                 );
  219.  
  220.                 RenderStepped:Wait();
  221.             end;
  222.         end;
  223.     end);
  224.  
  225.     if Library.IsMobile then
  226.         local Dragging, DraggingInput, DraggingStart, StartPosition;
  227.  
  228.         InputService.TouchStarted:Connect(function(Input)
  229.             if Library.CantDragForced == true then
  230.                 Dragging = false
  231.                 return;
  232.             end
  233.             if not Dragging and Library:MouseIsOverFrame(Instance, Input) and Library.Window.Holder.Visible == true then
  234.                 DraggingInput = Input;
  235.                 DraggingStart = Input.Position;
  236.                 StartPosition = Instance.Position;
  237.  
  238.                 local OffsetPos = Input.Position - DraggingStart;
  239.                 if OffsetPos.Y > (Cutoff or 40) then
  240.                     Dragging = false;
  241.                     return;
  242.                 end;
  243.  
  244.                 Dragging = true;
  245.             end;
  246.         end);
  247.         InputService.TouchMoved:Connect(function(Input)
  248.             if Library.CantDragForced == true then
  249.                 Dragging = false;
  250.                 return;
  251.             end
  252.             if Input == DraggingInput and Dragging and Library.CanDrag == true and Library.Window.Holder.Visible == true then
  253.                 local OffsetPos = Input.Position - DraggingStart;
  254.  
  255.                 Instance.Position = UDim2.new(
  256.                     StartPosition.X.Scale,
  257.                     StartPosition.X.Offset + OffsetPos.X,
  258.                     StartPosition.Y.Scale,
  259.                     StartPosition.Y.Offset + OffsetPos.Y
  260.                 );
  261.             end;
  262.         end);
  263.         InputService.TouchEnded:Connect(function(Input)
  264.             if Input == DraggingInput then
  265.                 Dragging = false;
  266.             end;
  267.         end);
  268.     end;
  269. end;
  270.  
  271. function Library:MakeResizable(Instance, MinSize)
  272.     if Library.IsMobile then
  273.         return;
  274.     end;
  275.  
  276.     Instance.Active = true;
  277.    
  278.     local ResizerImage_Size = 25;
  279.     local ResizerImage_HoverTransparency = 0.5;
  280.  
  281.     local Resizer = Library:Create('Frame', {
  282.         SizeConstraint = Enum.SizeConstraint.RelativeXX;
  283.         BackgroundColor3 = Color3.new(0, 0, 0);
  284.         BackgroundTransparency = 1;
  285.         BorderSizePixel = 0;
  286.         Size = UDim2.new(0, 30, 0, 30);
  287.         Position = UDim2.new(1, -30, 1, -30);
  288.         Visible = true;
  289.         ClipsDescendants = true;
  290.         ZIndex = 1;
  291.         Parent = Instance;--Library.ScreenGui;
  292.     });
  293.  
  294.     local ResizerImage = Library:Create('ImageButton', {
  295.         BackgroundColor3 = Library.AccentColor;
  296.         BackgroundTransparency = 1;
  297.         BorderSizePixel = 0;
  298.         Size = UDim2.new(2, 0, 2, 0);
  299.         Position = UDim2.new(1, -30, 1, -30);
  300.         ZIndex = 2;
  301.         Parent = Resizer;
  302.     });
  303.  
  304.     local ResizerImageUICorner = Library:Create('UICorner', {
  305.         CornerRadius = UDim.new(0.5, 0);
  306.         Parent = ResizerImage;
  307.     });
  308.  
  309.     Library:AddToRegistry(ResizerImage, { BackgroundColor3 = 'AccentColor'; });
  310.  
  311.     Resizer.Size = UDim2.fromOffset(ResizerImage_Size, ResizerImage_Size);
  312.     Resizer.Position = UDim2.new(1, -ResizerImage_Size, 1, -ResizerImage_Size);
  313.     MinSize = MinSize or Library.MinSize;
  314.  
  315.     local OffsetPos;
  316.     Resizer.Parent = Instance;
  317.  
  318.     local function FinishResize(Transparency)
  319.         ResizerImage.Position = UDim2.new();
  320.         ResizerImage.Size = UDim2.new(2, 0, 2, 0);
  321.         ResizerImage.Parent = Resizer;
  322.         ResizerImage.BackgroundTransparency = Transparency;
  323.         ResizerImageUICorner.Parent = ResizerImage;
  324.         OffsetPos = nil;
  325.     end;
  326.  
  327.     ResizerImage.MouseButton1Down:Connect(function()
  328.         if not OffsetPos then
  329.             OffsetPos = Vector2.new(Mouse.X - (Instance.AbsolutePosition.X + Instance.AbsoluteSize.X), Mouse.Y - (Instance.AbsolutePosition.Y + Instance.AbsoluteSize.Y));
  330.  
  331.             ResizerImage.BackgroundTransparency = 1
  332.             ResizerImage.Size = UDim2.fromOffset(Library.ScreenGui.AbsoluteSize.X, Library.ScreenGui.AbsoluteSize.Y);
  333.             ResizerImage.Position = UDim2.new();
  334.             ResizerImageUICorner.Parent = nil;
  335.             ResizerImage.Parent = Library.ScreenGui;
  336.         end;
  337.     end);
  338.  
  339.     ResizerImage.MouseMoved:Connect(function()
  340.         if OffsetPos then      
  341.             local MousePos = Vector2.new(Mouse.X - OffsetPos.X, Mouse.Y - OffsetPos.Y);
  342.             local FinalSize = Vector2.new(math.clamp(MousePos.X - Instance.AbsolutePosition.X, MinSize.X, math.huge), math.clamp(MousePos.Y - Instance.AbsolutePosition.Y, MinSize.Y, math.huge));
  343.             Instance.Size = UDim2.fromOffset(FinalSize.X, FinalSize.Y);
  344.         end;
  345.     end);
  346.  
  347.     ResizerImage.MouseEnter:Connect(function()
  348.         FinishResize(ResizerImage_HoverTransparency);      
  349.     end);
  350.  
  351.     ResizerImage.MouseLeave:Connect(function()
  352.         FinishResize(1);
  353.     end);
  354.  
  355.     ResizerImage.MouseButton1Up:Connect(function()
  356.         FinishResize(ResizerImage_HoverTransparency);
  357.     end);
  358. end;
  359.  
  360. function Library:AddToolTip(InfoStr, HoverInstance)
  361.     local X, Y = Library:GetTextBounds(InfoStr, Library.Font, 14);
  362.     local Tooltip = Library:Create('Frame', {
  363.         BackgroundColor3 = Library.MainColor,
  364.         BorderColor3 = Library.OutlineColor,
  365.  
  366.         Size = UDim2.fromOffset(X + 5, Y + 4),
  367.         ZIndex = 100,
  368.         Parent = Library.ScreenGui,
  369.  
  370.         Visible = false,
  371.     });
  372.  
  373.     local Label = Library:CreateLabel({
  374.         Position = UDim2.fromOffset(3, 1),
  375.         Size = UDim2.fromOffset(X, Y);
  376.         TextSize = 14;
  377.         Text = InfoStr,
  378.         TextColor3 = Library.FontColor,
  379.         TextXAlignment = Enum.TextXAlignment.Left;
  380.         ZIndex = Tooltip.ZIndex + 1,
  381.  
  382.         Parent = Tooltip;
  383.     });
  384.  
  385.     Library:AddToRegistry(Tooltip, {
  386.         BackgroundColor3 = 'MainColor';
  387.         BorderColor3 = 'OutlineColor';
  388.     });
  389.  
  390.     Library:AddToRegistry(Label, {
  391.         TextColor3 = 'FontColor',
  392.     });
  393.  
  394.     local IsHovering = false
  395.  
  396.     HoverInstance.MouseEnter:Connect(function()
  397.         if Library:MouseIsOverOpenedFrame() then
  398.             return
  399.         end
  400.  
  401.         IsHovering = true
  402.  
  403.         Tooltip.Position = UDim2.fromOffset(Mouse.X + 15, Mouse.Y + 12)
  404.         Tooltip.Visible = true
  405.  
  406.         while IsHovering do
  407.             RunService.Heartbeat:Wait()
  408.             Tooltip.Position = UDim2.fromOffset(Mouse.X + 15, Mouse.Y + 12)
  409.         end
  410.     end)
  411.  
  412.     HoverInstance.MouseLeave:Connect(function()
  413.         IsHovering = false
  414.         Tooltip.Visible = false
  415.     end)
  416.    
  417.     if LibraryMainOuterFrame then
  418.         LibraryMainOuterFrame:GetPropertyChangedSignal("Visible"):Connect(function()
  419.             if LibraryMainOuterFrame.Visible == false then
  420.                 IsHovering = false
  421.                 Tooltip.Visible = false
  422.             end
  423.         end)
  424.     end
  425. end
  426.  
  427. function Library:OnHighlight(HighlightInstance, Instance, Properties, PropertiesDefault, condition)
  428.     local function undoHighlight()
  429.         local Reg = Library.RegistryMap[Instance];
  430.  
  431.         for Property, ColorIdx in next, PropertiesDefault do
  432.             Instance[Property] = Library[ColorIdx] or ColorIdx;
  433.  
  434.             if Reg and Reg.Properties[Property] then
  435.                 Reg.Properties[Property] = ColorIdx;
  436.             end;
  437.         end;
  438.     end
  439.     local function doHighlight()
  440.         if condition and not condition() then undoHighlight() return end
  441.         local Reg = Library.RegistryMap[Instance];
  442.  
  443.         for Property, ColorIdx in next, Properties do
  444.             Instance[Property] = Library[ColorIdx] or ColorIdx;
  445.  
  446.             if Reg and Reg.Properties[Property] then
  447.                 Reg.Properties[Property] = ColorIdx;
  448.             end;
  449.         end;
  450.     end
  451.  
  452.     HighlightInstance.MouseEnter:Connect(function()
  453.         doHighlight()
  454.     end)
  455.     HighlightInstance.MouseMoved:Connect(function()
  456.         doHighlight()
  457.     end)
  458.     HighlightInstance.MouseLeave:Connect(function()
  459.         undoHighlight()
  460.     end)
  461. end;
  462.  
  463. function Library:MouseIsOverOpenedFrame(Input)
  464.     local Pos = Mouse;
  465.     if Library.IsMobile and Input then
  466.         Pos = Input.Position;
  467.     end;
  468.     for Frame, _ in next, Library.OpenedFrames do
  469.         local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize;
  470.  
  471.         if Pos.X >= AbsPos.X and Pos.X <= AbsPos.X + AbsSize.X
  472.             and Pos.Y >= AbsPos.Y and Pos.Y <= AbsPos.Y + AbsSize.Y then
  473.  
  474.             return true;
  475.         end;
  476.     end;
  477. end;
  478.  
  479. function Library:MouseIsOverFrame(Frame, Input)
  480.     local Pos = Mouse;
  481.     if Library.IsMobile and Input then
  482.         Pos = Input.Position;
  483.     end;
  484.     local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize;
  485.  
  486.     if Pos.X >= AbsPos.X and Pos.X <= AbsPos.X + AbsSize.X
  487.         and Pos.Y >= AbsPos.Y and Pos.Y <= AbsPos.Y + AbsSize.Y then
  488.  
  489.         return true;
  490.     end;
  491. end;
  492.  
  493. function Library:UpdateDependencyBoxes()
  494.     for _, Depbox in next, Library.DependencyBoxes do
  495.         Depbox:Update();
  496.     end;
  497. end;
  498.  
  499. function Library:MapValue(Value, MinA, MaxA, MinB, MaxB)
  500.     return (1 - ((Value - MinA) / (MaxA - MinA))) * MinB + ((Value - MinA) / (MaxA - MinA)) * MaxB;
  501. end;
  502.  
  503. function Library:GetTextBounds(Text, Font, Size, Resolution)
  504.     local Bounds = TextService:GetTextSize(Text, Size, Font, Resolution or Vector2.new(1920, 1080))
  505.     return Bounds.X, Bounds.Y
  506. end;
  507.  
  508. function Library:GetDarkerColor(Color)
  509.     local H, S, V = Color3.toHSV(Color);
  510.     return Color3.fromHSV(H, S, V / 1.5);
  511. end;
  512. Library.AccentColorDark = Library:GetDarkerColor(Library.AccentColor);
  513.  
  514. function Library:AddToRegistry(Instance, Properties, IsHud)
  515.     local Idx = #Library.Registry + 1;
  516.     local Data = {
  517.         Instance = Instance;
  518.         Properties = Properties;
  519.         Idx = Idx;
  520.     };
  521.  
  522.     table.insert(Library.Registry, Data);
  523.     Library.RegistryMap[Instance] = Data;
  524.  
  525.     if IsHud then
  526.         table.insert(Library.HudRegistry, Data);
  527.     end;
  528. end;
  529.  
  530. function Library:RemoveFromRegistry(Instance)
  531.     local Data = Library.RegistryMap[Instance];
  532.  
  533.     if Data then
  534.         for Idx = #Library.Registry, 1, -1 do
  535.             if Library.Registry[Idx] == Data then
  536.                 table.remove(Library.Registry, Idx);
  537.             end;
  538.         end;
  539.  
  540.         for Idx = #Library.HudRegistry, 1, -1 do
  541.             if Library.HudRegistry[Idx] == Data then
  542.                 table.remove(Library.HudRegistry, Idx);
  543.             end;
  544.         end;
  545.  
  546.         Library.RegistryMap[Instance] = nil;
  547.     end;
  548. end;
  549.  
  550. function Library:UpdateColorsUsingRegistry()
  551.     -- TODO: Could have an 'active' list of objects
  552.     -- where the active list only contains Visible objects.
  553.  
  554.     -- IMPL: Could setup .Changed events on the AddToRegistry function
  555.     -- that listens for the 'Visible' propert being changed.
  556.     -- Visible: true => Add to active list, and call UpdateColors function
  557.     -- Visible: false => Remove from active list.
  558.  
  559.     -- The above would be especially efficient for a rainbow menu color or live color-changing.
  560.  
  561.     for Idx, Object in next, Library.Registry do
  562.         for Property, ColorIdx in next, Object.Properties do
  563.             if type(ColorIdx) == 'string' then
  564.                 Object.Instance[Property] = Library[ColorIdx];
  565.             elseif type(ColorIdx) == 'function' then
  566.                 Object.Instance[Property] = ColorIdx()
  567.             end
  568.         end;
  569.     end;
  570. end;
  571.  
  572. function Library:GiveSignal(Signal)
  573.     -- Only used for signals not attached to library instances, as those should be cleaned up on object destruction by Roblox
  574.     table.insert(Library.Signals, Signal)
  575. end
  576.  
  577. function Library:Unload()
  578.     -- Unload all of the signals
  579.     for Idx = #Library.Signals, 1, -1 do
  580.         local Connection = table.remove(Library.Signals, Idx)
  581.         Connection:Disconnect()
  582.     end
  583.  
  584.     -- Call our unload callback, maybe to undo some hooks etc
  585.     if Library.OnUnload then
  586.         Library.OnUnload()
  587.     end
  588.  
  589.     ScreenGui:Destroy()
  590. end
  591.  
  592. function Library:OnUnload(Callback)
  593.     Library.OnUnload = Callback
  594. end
  595.  
  596. Library:GiveSignal(ScreenGui.DescendantRemoving:Connect(function(Instance)
  597.     if Library.RegistryMap[Instance] then
  598.         Library:RemoveFromRegistry(Instance);
  599.     end;
  600. end))
  601.  
  602. local BaseAddons = {};
  603.  
  604. do
  605.     local Funcs = {};
  606.  
  607.     function Funcs:AddColorPicker(Idx, Info)
  608.         local ParentObj = self
  609.         local ToggleLabel = self.TextLabel;
  610.         --local Container = self.Container;
  611.  
  612.         assert(Info.Default, 'AddColorPicker: Missing default value.');
  613.  
  614.         local ColorPicker = {
  615.             Value = Info.Default;
  616.             Transparency = Info.Transparency or 0;
  617.             Type = 'ColorPicker';
  618.             Title = type(Info.Title) == 'string' and Info.Title or 'Color picker',
  619.             Callback = Info.Callback or function(Color) end;
  620.         };
  621.  
  622.         function ColorPicker:SetHSVFromRGB(Color)
  623.             local H, S, V = Color3.toHSV(Color);
  624.  
  625.             ColorPicker.Hue = H;
  626.             ColorPicker.Sat = S;
  627.             ColorPicker.Vib = V;
  628.         end;
  629.  
  630.         ColorPicker:SetHSVFromRGB(ColorPicker.Value);
  631.  
  632.         local DisplayFrame = Library:Create('Frame', {
  633.             BackgroundColor3 = ColorPicker.Value;
  634.             BorderColor3 = Library:GetDarkerColor(ColorPicker.Value);
  635.             BorderMode = Enum.BorderMode.Inset;
  636.             Size = UDim2.new(0, 28, 0, 14);
  637.             ZIndex = 6;
  638.             Parent = ToggleLabel;
  639.         });
  640.  
  641.         -- Transparency image taken from https://github.com/matas3535/SplixPrivateDrawingLibrary/blob/main/Library.lua cus i'm lazy
  642.         local CheckerFrame = Library:Create('ImageLabel', {
  643.             BorderSizePixel = 0;
  644.             Size = UDim2.new(0, 27, 0, 13);
  645.             ZIndex = 5;
  646.             Image = 'http://www.roblox.com/asset/?id=12977615774';
  647.             Visible = not not Info.Transparency;
  648.             Parent = DisplayFrame;
  649.         });
  650.  
  651.         -- 1/16/23
  652.         -- Rewrote this to be placed inside the Library ScreenGui
  653.         -- There was some issue which caused RelativeOffset to be way off
  654.         -- Thus the color picker would never show
  655.  
  656.         local PickerFrameOuter = Library:Create('Frame', {
  657.             Name = 'Color';
  658.             BackgroundColor3 = Color3.new(1, 1, 1);
  659.             BorderColor3 = Color3.new(0, 0, 0);
  660.             Position = UDim2.fromOffset(DisplayFrame.AbsolutePosition.X, DisplayFrame.AbsolutePosition.Y + 18),
  661.             Size = UDim2.fromOffset(230, Info.Transparency and 271 or 253);
  662.             Visible = false;
  663.             ZIndex = 15;
  664.             Parent = ScreenGui,
  665.         });
  666.  
  667.         DisplayFrame:GetPropertyChangedSignal('AbsolutePosition'):Connect(function()
  668.             PickerFrameOuter.Position = UDim2.fromOffset(DisplayFrame.AbsolutePosition.X, DisplayFrame.AbsolutePosition.Y + 18);
  669.         end)
  670.  
  671.         local PickerFrameInner = Library:Create('Frame', {
  672.             BackgroundColor3 = Library.BackgroundColor;
  673.             BorderColor3 = Library.OutlineColor;
  674.             BorderMode = Enum.BorderMode.Inset;
  675.             Size = UDim2.new(1, 0, 1, 0);
  676.             ZIndex = 16;
  677.             Parent = PickerFrameOuter;
  678.         });
  679.  
  680.         local Highlight = Library:Create('Frame', {
  681.             BackgroundColor3 = Library.AccentColor;
  682.             BorderSizePixel = 0;
  683.             Size = UDim2.new(1, 0, 0, 2);
  684.             ZIndex = 17;
  685.             Parent = PickerFrameInner;
  686.         });
  687.  
  688.         local SatVibMapOuter = Library:Create('Frame', {
  689.             BorderColor3 = Color3.new(0, 0, 0);
  690.             Position = UDim2.new(0, 4, 0, 25);
  691.             Size = UDim2.new(0, 200, 0, 200);
  692.             ZIndex = 17;
  693.             Parent = PickerFrameInner;
  694.         });
  695.  
  696.         local SatVibMapInner = Library:Create('Frame', {
  697.             BackgroundColor3 = Library.BackgroundColor;
  698.             BorderColor3 = Library.OutlineColor;
  699.             BorderMode = Enum.BorderMode.Inset;
  700.             Size = UDim2.new(1, 0, 1, 0);
  701.             ZIndex = 18;
  702.             Parent = SatVibMapOuter;
  703.         });
  704.  
  705.         local SatVibMap = Library:Create('ImageLabel', {
  706.             BorderSizePixel = 0;
  707.             Size = UDim2.new(1, 0, 1, 0);
  708.             ZIndex = 18;
  709.             Image = 'rbxassetid://4155801252';
  710.             Parent = SatVibMapInner;
  711.         });
  712.  
  713.         local CursorOuter = Library:Create('ImageLabel', {
  714.             AnchorPoint = Vector2.new(0.5, 0.5);
  715.             Size = UDim2.new(0, 6, 0, 6);
  716.             BackgroundTransparency = 1;
  717.             Image = 'http://www.roblox.com/asset/?id=9619665977';
  718.             ImageColor3 = Color3.new(0, 0, 0);
  719.             ZIndex = 19;
  720.             Parent = SatVibMap;
  721.         });
  722.  
  723.         local CursorInner = Library:Create('ImageLabel', {
  724.             Size = UDim2.new(0, CursorOuter.Size.X.Offset - 2, 0, CursorOuter.Size.Y.Offset - 2);
  725.             Position = UDim2.new(0, 1, 0, 1);
  726.             BackgroundTransparency = 1;
  727.             Image = 'http://www.roblox.com/asset/?id=9619665977';
  728.             ZIndex = 20;
  729.             Parent = CursorOuter;
  730.         })
  731.  
  732.         local HueSelectorOuter = Library:Create('Frame', {
  733.             BorderColor3 = Color3.new(0, 0, 0);
  734.             Position = UDim2.new(0, 208, 0, 25);
  735.             Size = UDim2.new(0, 15, 0, 200);
  736.             ZIndex = 17;
  737.             Parent = PickerFrameInner;
  738.         });
  739.  
  740.         local HueSelectorInner = Library:Create('Frame', {
  741.             BackgroundColor3 = Color3.new(1, 1, 1);
  742.             BorderSizePixel = 0;
  743.             Size = UDim2.new(1, 0, 1, 0);
  744.             ZIndex = 18;
  745.             Parent = HueSelectorOuter;
  746.         });
  747.  
  748.         local HueCursor = Library:Create('Frame', {
  749.             BackgroundColor3 = Color3.new(1, 1, 1);
  750.             AnchorPoint = Vector2.new(0, 0.5);
  751.             BorderColor3 = Color3.new(0, 0, 0);
  752.             Size = UDim2.new(1, 0, 0, 1);
  753.             ZIndex = 18;
  754.             Parent = HueSelectorInner;
  755.         });
  756.  
  757.         local HueBoxOuter = Library:Create('Frame', {
  758.             BorderColor3 = Color3.new(0, 0, 0);
  759.             Position = UDim2.fromOffset(4, 228),
  760.             Size = UDim2.new(0.5, -6, 0, 20),
  761.             ZIndex = 18,
  762.             Parent = PickerFrameInner;
  763.         });
  764.  
  765.         local HueBoxInner = Library:Create('Frame', {
  766.             BackgroundColor3 = Library.MainColor;
  767.             BorderColor3 = Library.OutlineColor;
  768.             BorderMode = Enum.BorderMode.Inset;
  769.             Size = UDim2.new(1, 0, 1, 0);
  770.             ZIndex = 18,
  771.             Parent = HueBoxOuter;
  772.         });
  773.  
  774.         Library:Create('UIGradient', {
  775.             Color = ColorSequence.new({
  776.                 ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  777.                 ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  778.             });
  779.             Rotation = 90;
  780.             Parent = HueBoxInner;
  781.         });
  782.  
  783.         local HueBox = Library:Create('TextBox', {
  784.             BackgroundTransparency = 1;
  785.             Position = UDim2.new(0, 5, 0, 0);
  786.             Size = UDim2.new(1, -5, 1, 0);
  787.             Font = Library.Font;
  788.             PlaceholderColor3 = Color3.fromRGB(190, 190, 190);
  789.             PlaceholderText = 'Hex color',
  790.             Text = '#FFFFFF',
  791.             TextColor3 = Library.FontColor;
  792.             TextSize = 14;
  793.             TextStrokeTransparency = 0;
  794.             TextXAlignment = Enum.TextXAlignment.Left;
  795.             ZIndex = 20,
  796.             Parent = HueBoxInner;
  797.         });
  798.  
  799.         Library:ApplyTextStroke(HueBox);
  800.  
  801.         local RgbBoxBase = Library:Create(HueBoxOuter:Clone(), {
  802.             Position = UDim2.new(0.5, 2, 0, 228),
  803.             Size = UDim2.new(0.5, -6, 0, 20),
  804.             Parent = PickerFrameInner
  805.         });
  806.  
  807.         local RgbBox = Library:Create(RgbBoxBase.Frame:FindFirstChild('TextBox'), {
  808.             Text = '255, 255, 255',
  809.             PlaceholderText = 'RGB color',
  810.             TextColor3 = Library.FontColor
  811.         });
  812.  
  813.         local TransparencyBoxOuter, TransparencyBoxInner, TransparencyCursor;
  814.        
  815.         if Info.Transparency then
  816.             TransparencyBoxOuter = Library:Create('Frame', {
  817.                 BorderColor3 = Color3.new(0, 0, 0);
  818.                 Position = UDim2.fromOffset(4, 251);
  819.                 Size = UDim2.new(1, -8, 0, 15);
  820.                 ZIndex = 19;
  821.                 Parent = PickerFrameInner;
  822.             });
  823.  
  824.             TransparencyBoxInner = Library:Create('Frame', {
  825.                 BackgroundColor3 = ColorPicker.Value;
  826.                 BorderColor3 = Library.OutlineColor;
  827.                 BorderMode = Enum.BorderMode.Inset;
  828.                 Size = UDim2.new(1, 0, 1, 0);
  829.                 ZIndex = 19;
  830.                 Parent = TransparencyBoxOuter;
  831.             });
  832.  
  833.             Library:AddToRegistry(TransparencyBoxInner, { BorderColor3 = 'OutlineColor' });
  834.  
  835.             Library:Create('ImageLabel', {
  836.                 BackgroundTransparency = 1;
  837.                 Size = UDim2.new(1, 0, 1, 0);
  838.                 Image = 'http://www.roblox.com/asset/?id=12978095818';
  839.                 ZIndex = 20;
  840.                 Parent = TransparencyBoxInner;
  841.             });
  842.  
  843.             TransparencyCursor = Library:Create('Frame', {
  844.                 BackgroundColor3 = Color3.new(1, 1, 1);
  845.                 AnchorPoint = Vector2.new(0.5, 0);
  846.                 BorderColor3 = Color3.new(0, 0, 0);
  847.                 Size = UDim2.new(0, 1, 1, 0);
  848.                 ZIndex = 21;
  849.                 Parent = TransparencyBoxInner;
  850.             });
  851.         end;
  852.  
  853.         local DisplayLabel = Library:CreateLabel({
  854.             Size = UDim2.new(1, 0, 0, 14);
  855.             Position = UDim2.fromOffset(5, 5);
  856.             TextXAlignment = Enum.TextXAlignment.Left;
  857.             TextSize = 14;
  858.             Text = ColorPicker.Title,--Info.Default;
  859.             TextWrapped = false;
  860.             ZIndex = 16;
  861.             Parent = PickerFrameInner;
  862.         });
  863.  
  864.  
  865.         local ContextMenu = {}
  866.         do
  867.             ContextMenu.Options = {}
  868.             ContextMenu.Container = Library:Create('Frame', {
  869.                 BorderColor3 = Color3.new(),
  870.                 ZIndex = 14,
  871.  
  872.                 Visible = false,
  873.                 Parent = ScreenGui
  874.             })
  875.  
  876.             ContextMenu.Inner = Library:Create('Frame', {
  877.                 BackgroundColor3 = Library.BackgroundColor;
  878.                 BorderColor3 = Library.OutlineColor;
  879.                 BorderMode = Enum.BorderMode.Inset;
  880.                 Size = UDim2.fromScale(1, 1);
  881.                 ZIndex = 15;
  882.                 Parent = ContextMenu.Container;
  883.             });
  884.  
  885.             Library:Create('UIListLayout', {
  886.                 Name = 'Layout',
  887.                 FillDirection = Enum.FillDirection.Vertical;
  888.                 SortOrder = Enum.SortOrder.LayoutOrder;
  889.                 Parent = ContextMenu.Inner;
  890.             });
  891.  
  892.             Library:Create('UIPadding', {
  893.                 Name = 'Padding',
  894.                 PaddingLeft = UDim.new(0, 4),
  895.                 Parent = ContextMenu.Inner,
  896.             });
  897.  
  898.             local function updateMenuPosition()
  899.                 ContextMenu.Container.Position = UDim2.fromOffset(
  900.                     (DisplayFrame.AbsolutePosition.X + DisplayFrame.AbsoluteSize.X) + 4,
  901.                     DisplayFrame.AbsolutePosition.Y + 1
  902.                 )
  903.             end
  904.  
  905.             local function updateMenuSize()
  906.                 local menuWidth = 60
  907.                 for i, label in next, ContextMenu.Inner:GetChildren() do
  908.                     if label:IsA('TextLabel') then
  909.                         menuWidth = math.max(menuWidth, label.TextBounds.X)
  910.                     end
  911.                 end
  912.  
  913.                 ContextMenu.Container.Size = UDim2.fromOffset(
  914.                     menuWidth + 8,
  915.                     ContextMenu.Inner.Layout.AbsoluteContentSize.Y + 4
  916.                 )
  917.             end
  918.  
  919.             DisplayFrame:GetPropertyChangedSignal('AbsolutePosition'):Connect(updateMenuPosition)
  920.             ContextMenu.Inner.Layout:GetPropertyChangedSignal('AbsoluteContentSize'):Connect(updateMenuSize)
  921.  
  922.             task.spawn(updateMenuPosition)
  923.             task.spawn(updateMenuSize)
  924.  
  925.             Library:AddToRegistry(ContextMenu.Inner, {
  926.                 BackgroundColor3 = 'BackgroundColor';
  927.                 BorderColor3 = 'OutlineColor';
  928.             });
  929.  
  930.             function ContextMenu:Show()
  931.                 if Library.IsMobile then
  932.                     Library.CanDrag = false;
  933.                 end;
  934.  
  935.                 self.Container.Visible = true;
  936.             end
  937.  
  938.             function ContextMenu:Hide()
  939.                 if Library.IsMobile then
  940.                     Library.CanDrag = true;
  941.                 end;
  942.                
  943.                 self.Container.Visible = false;
  944.             end
  945.  
  946.             function ContextMenu:AddOption(Str, Callback)
  947.                 if type(Callback) ~= 'function' then
  948.                     Callback = function() end
  949.                 end
  950.  
  951.                 local Button = Library:CreateLabel({
  952.                     Active = false;
  953.                     Size = UDim2.new(1, 0, 0, 15);
  954.                     TextSize = 13;
  955.                     Text = Str;
  956.                     ZIndex = 16;
  957.                     Parent = self.Inner;
  958.                     TextXAlignment = Enum.TextXAlignment.Left,
  959.                 });
  960.  
  961.                 Library:OnHighlight(Button, Button,
  962.                     { TextColor3 = 'AccentColor' },
  963.                     { TextColor3 = 'FontColor' }
  964.                 );
  965.  
  966.                 Button.InputBegan:Connect(function(Input)
  967.                     if Input.UserInputType ~= Enum.UserInputType.MouseButton1 or Input.UserInputType ~= Enum.UserInputType.Touch then
  968.                         return
  969.                     end
  970.  
  971.                     Callback()
  972.                 end)
  973.             end
  974.  
  975.             ContextMenu:AddOption('Copy color', function()
  976.                 Library.ColorClipboard = ColorPicker.Value
  977.                 Library:Notify('Copied color!', 2)
  978.             end)
  979.  
  980.             ContextMenu:AddOption('Paste color', function()
  981.                 if not Library.ColorClipboard then
  982.                     return Library:Notify('You have not copied a color!', 2)
  983.                 end
  984.                 ColorPicker:SetValueRGB(Library.ColorClipboard)
  985.             end)
  986.  
  987.  
  988.             ContextMenu:AddOption('Copy HEX', function()
  989.                 pcall(setclipboard, ColorPicker.Value:ToHex())
  990.                 Library:Notify('Copied hex code to clipboard!', 2)
  991.             end)
  992.  
  993.             ContextMenu:AddOption('Copy RGB', function()
  994.                 pcall(setclipboard, table.concat({ math.floor(ColorPicker.Value.R * 255), math.floor(ColorPicker.Value.G * 255), math.floor(ColorPicker.Value.B * 255) }, ', '))
  995.                 Library:Notify('Copied RGB values to clipboard!', 2)
  996.             end)
  997.  
  998.         end
  999.  
  1000.         Library:AddToRegistry(PickerFrameInner, { BackgroundColor3 = 'BackgroundColor'; BorderColor3 = 'OutlineColor'; });
  1001.         Library:AddToRegistry(Highlight, { BackgroundColor3 = 'AccentColor'; });
  1002.         Library:AddToRegistry(SatVibMapInner, { BackgroundColor3 = 'BackgroundColor'; BorderColor3 = 'OutlineColor'; });
  1003.  
  1004.         Library:AddToRegistry(HueBoxInner, { BackgroundColor3 = 'MainColor'; BorderColor3 = 'OutlineColor'; });
  1005.         Library:AddToRegistry(RgbBoxBase.Frame, { BackgroundColor3 = 'MainColor'; BorderColor3 = 'OutlineColor'; });
  1006.         Library:AddToRegistry(RgbBox, { TextColor3 = 'FontColor', });
  1007.         Library:AddToRegistry(HueBox, { TextColor3 = 'FontColor', });
  1008.  
  1009.         local SequenceTable = {};
  1010.  
  1011.         for Hue = 0, 1, 0.1 do
  1012.             table.insert(SequenceTable, ColorSequenceKeypoint.new(Hue, Color3.fromHSV(Hue, 1, 1)));
  1013.         end;
  1014.  
  1015.         local HueSelectorGradient = Library:Create('UIGradient', {
  1016.             Color = ColorSequence.new(SequenceTable);
  1017.             Rotation = 90;
  1018.             Parent = HueSelectorInner;
  1019.         });
  1020.  
  1021.         HueBox.FocusLost:Connect(function(enter)
  1022.             if enter then
  1023.                 local success, result = pcall(Color3.fromHex, HueBox.Text)
  1024.                 if success and typeof(result) == 'Color3' then
  1025.                     ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib = Color3.toHSV(result)
  1026.                 end
  1027.             end
  1028.  
  1029.             ColorPicker:Display()
  1030.         end)
  1031.  
  1032.         RgbBox.FocusLost:Connect(function(enter)
  1033.             if enter then
  1034.                 local r, g, b = RgbBox.Text:match('(%d+),%s*(%d+),%s*(%d+)')
  1035.                 if r and g and b then
  1036.                     ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib = Color3.toHSV(Color3.fromRGB(r, g, b))
  1037.                 end
  1038.             end
  1039.  
  1040.             ColorPicker:Display()
  1041.         end)
  1042.  
  1043.         function ColorPicker:Display()
  1044.             ColorPicker.Value = Color3.fromHSV(ColorPicker.Hue, ColorPicker.Sat, ColorPicker.Vib);
  1045.             SatVibMap.BackgroundColor3 = Color3.fromHSV(ColorPicker.Hue, 1, 1);
  1046.  
  1047.             Library:Create(DisplayFrame, {
  1048.                 BackgroundColor3 = ColorPicker.Value;
  1049.                 BackgroundTransparency = ColorPicker.Transparency;
  1050.                 BorderColor3 = Library:GetDarkerColor(ColorPicker.Value);
  1051.             });
  1052.  
  1053.             if TransparencyBoxInner then
  1054.                 TransparencyBoxInner.BackgroundColor3 = ColorPicker.Value;
  1055.                 TransparencyCursor.Position = UDim2.new(1 - ColorPicker.Transparency, 0, 0, 0);
  1056.             end;
  1057.  
  1058.             CursorOuter.Position = UDim2.new(ColorPicker.Sat, 0, 1 - ColorPicker.Vib, 0);
  1059.             HueCursor.Position = UDim2.new(0, 0, ColorPicker.Hue, 0);
  1060.  
  1061.             HueBox.Text = '#' .. ColorPicker.Value:ToHex()
  1062.             RgbBox.Text = table.concat({ math.floor(ColorPicker.Value.R * 255), math.floor(ColorPicker.Value.G * 255), math.floor(ColorPicker.Value.B * 255) }, ', ')
  1063.  
  1064.             Library:SafeCallback(ColorPicker.Callback, ColorPicker.Value);
  1065.             Library:SafeCallback(ColorPicker.Changed, ColorPicker.Value);
  1066.         end;
  1067.  
  1068.         function ColorPicker:OnChanged(Func)
  1069.             ColorPicker.Changed = Func;
  1070.             Func(ColorPicker.Value)
  1071.         end;
  1072.  
  1073.         if ParentObj.Addons then
  1074.             table.insert(ParentObj.Addons, ColorPicker)
  1075.         end
  1076.  
  1077.         function ColorPicker:Show()
  1078.             for Frame, Val in next, Library.OpenedFrames do
  1079.                 if Frame.Name == 'Color' then
  1080.                     Frame.Visible = false;
  1081.                     Library.OpenedFrames[Frame] = nil;
  1082.                 end;
  1083.             end;
  1084.  
  1085.             PickerFrameOuter.Visible = true;
  1086.             Library.OpenedFrames[PickerFrameOuter] = true;
  1087.         end;
  1088.  
  1089.         function ColorPicker:Hide()
  1090.             PickerFrameOuter.Visible = false;
  1091.             Library.OpenedFrames[PickerFrameOuter] = nil;
  1092.         end;
  1093.  
  1094.         function ColorPicker:SetValue(HSV, Transparency)
  1095.             local Color = Color3.fromHSV(HSV[1], HSV[2], HSV[3]);
  1096.  
  1097.             ColorPicker.Transparency = Transparency or 0;
  1098.             ColorPicker:SetHSVFromRGB(Color);
  1099.             ColorPicker:Display();
  1100.         end;
  1101.  
  1102.         function ColorPicker:SetValueRGB(Color, Transparency)
  1103.             ColorPicker.Transparency = Transparency or 0;
  1104.             ColorPicker:SetHSVFromRGB(Color);
  1105.             ColorPicker:Display();
  1106.         end;
  1107.  
  1108.         SatVibMap.InputBegan:Connect(function(Input)
  1109.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1110.                 while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch) do
  1111.                     local MinX = SatVibMap.AbsolutePosition.X;
  1112.                     local MaxX = MinX + SatVibMap.AbsoluteSize.X;
  1113.                     local MouseX = math.clamp(Mouse.X, MinX, MaxX);
  1114.  
  1115.                     local MinY = SatVibMap.AbsolutePosition.Y;
  1116.                     local MaxY = MinY + SatVibMap.AbsoluteSize.Y;
  1117.                     local MouseY = math.clamp(Mouse.Y, MinY, MaxY);
  1118.  
  1119.                     ColorPicker.Sat = (MouseX - MinX) / (MaxX - MinX);
  1120.                     ColorPicker.Vib = 1 - ((MouseY - MinY) / (MaxY - MinY));
  1121.                     ColorPicker:Display();
  1122.  
  1123.                     RenderStepped:Wait();
  1124.                 end;
  1125.  
  1126.                 Library:AttemptSave();
  1127.             end;
  1128.         end);
  1129.  
  1130.         HueSelectorInner.InputBegan:Connect(function(Input)
  1131.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1132.                 while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch) do
  1133.                     local MinY = HueSelectorInner.AbsolutePosition.Y;
  1134.                     local MaxY = MinY + HueSelectorInner.AbsoluteSize.Y;
  1135.                     local MouseY = math.clamp(Mouse.Y, MinY, MaxY);
  1136.  
  1137.                     ColorPicker.Hue = ((MouseY - MinY) / (MaxY - MinY));
  1138.                     ColorPicker:Display();
  1139.  
  1140.                     RenderStepped:Wait();
  1141.                 end;
  1142.  
  1143.                 Library:AttemptSave();
  1144.             end;
  1145.         end);
  1146.  
  1147.         DisplayFrame.InputBegan:Connect(function(Input)
  1148.             if Library:MouseIsOverOpenedFrame() then
  1149.                 return;
  1150.             end;
  1151.  
  1152.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1153.                 if PickerFrameOuter.Visible then
  1154.                     ColorPicker:Hide()
  1155.                 else
  1156.                     ContextMenu:Hide()
  1157.                     ColorPicker:Show()
  1158.                 end;
  1159.             elseif Input.UserInputType == Enum.UserInputType.MouseButton2 then
  1160.                 ContextMenu:Show()
  1161.                 ColorPicker:Hide()
  1162.             end
  1163.         end);
  1164.  
  1165.         if TransparencyBoxInner then
  1166.             TransparencyBoxInner.InputBegan:Connect(function(Input)
  1167.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1168.                     while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch) do
  1169.                         local MinX = TransparencyBoxInner.AbsolutePosition.X;
  1170.                         local MaxX = MinX + TransparencyBoxInner.AbsoluteSize.X;
  1171.                         local MouseX = math.clamp(Mouse.X, MinX, MaxX);
  1172.  
  1173.                         ColorPicker.Transparency = 1 - ((MouseX - MinX) / (MaxX - MinX));
  1174.  
  1175.                         ColorPicker:Display();
  1176.  
  1177.                         RenderStepped:Wait();
  1178.                     end;
  1179.  
  1180.                     Library:AttemptSave();
  1181.                 end;
  1182.             end);
  1183.         end;
  1184.  
  1185.         Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
  1186.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1187.                 local AbsPos, AbsSize = PickerFrameOuter.AbsolutePosition, PickerFrameOuter.AbsoluteSize;
  1188.  
  1189.                 if Mouse.X < AbsPos.X or Mouse.X > AbsPos.X + AbsSize.X
  1190.                     or Mouse.Y < (AbsPos.Y - 20 - 1) or Mouse.Y > AbsPos.Y + AbsSize.Y then
  1191.  
  1192.                     ColorPicker:Hide();
  1193.                 end;
  1194.  
  1195.                 if not Library:MouseIsOverFrame(ContextMenu.Container) then
  1196.                     ContextMenu:Hide()
  1197.                 end
  1198.             end;
  1199.  
  1200.             if Input.UserInputType == Enum.UserInputType.MouseButton2 and ContextMenu.Container.Visible then
  1201.                 if not Library:MouseIsOverFrame(ContextMenu.Container) and not Library:MouseIsOverFrame(DisplayFrame) then
  1202.                     ContextMenu:Hide()
  1203.                 end
  1204.             end
  1205.         end))
  1206.  
  1207.         ColorPicker:Display();
  1208.         ColorPicker.DisplayFrame = DisplayFrame
  1209.  
  1210.         Options[Idx] = ColorPicker;
  1211.  
  1212.         return self;
  1213.     end;
  1214.  
  1215.     function Funcs:AddKeyPicker(Idx, Info)
  1216.         local ParentObj = self;
  1217.         local ToggleLabel = self.TextLabel;
  1218.         local Container = self.Container;
  1219.  
  1220.         assert(Info.Default, 'AddKeyPicker: Missing default value.');
  1221.  
  1222.         local KeyPicker = {
  1223.             Value = Info.Default;
  1224.             Toggled = false;
  1225.             Mode = Info.Mode or 'Toggle'; -- Always, Toggle, Hold
  1226.             Type = 'KeyPicker';
  1227.             Callback = Info.Callback or function(Value) end;
  1228.             ChangedCallback = Info.ChangedCallback or function(New) end;
  1229.             SyncToggleState = Info.SyncToggleState or false;
  1230.         };
  1231.  
  1232.         if KeyPicker.SyncToggleState then
  1233.             Info.Modes = { 'Toggle' }
  1234.             Info.Mode = 'Toggle'
  1235.         end
  1236.  
  1237.         local PickOuter = Library:Create('Frame', {
  1238.             BackgroundColor3 = Color3.new(0, 0, 0);
  1239.             BorderColor3 = Color3.new(0, 0, 0);
  1240.             Size = UDim2.new(0, 28, 0, 15);
  1241.             ZIndex = 6;
  1242.             Parent = ToggleLabel;
  1243.         });
  1244.  
  1245.         local PickInner = Library:Create('Frame', {
  1246.             BackgroundColor3 = Library.BackgroundColor;
  1247.             BorderColor3 = Library.OutlineColor;
  1248.             BorderMode = Enum.BorderMode.Inset;
  1249.             Size = UDim2.new(1, 0, 1, 0);
  1250.             ZIndex = 7;
  1251.             Parent = PickOuter;
  1252.         });
  1253.  
  1254.         Library:AddToRegistry(PickInner, {
  1255.             BackgroundColor3 = 'BackgroundColor';
  1256.             BorderColor3 = 'OutlineColor';
  1257.         });
  1258.  
  1259.         local DisplayLabel = Library:CreateLabel({
  1260.             Size = UDim2.new(1, 0, 1, 0);
  1261.             TextSize = 13;
  1262.             Text = Info.Default;
  1263.             TextWrapped = true;
  1264.             ZIndex = 8;
  1265.             Parent = PickInner;
  1266.         });
  1267.  
  1268.         local ModeSelectOuter = Library:Create('Frame', {
  1269.             BorderColor3 = Color3.new(0, 0, 0);
  1270.             Position = UDim2.fromOffset(ToggleLabel.AbsolutePosition.X + ToggleLabel.AbsoluteSize.X + 4, ToggleLabel.AbsolutePosition.Y + 1);
  1271.             Size = UDim2.new(0, 60, 0, 45 + 2);
  1272.             Visible = false;
  1273.             ZIndex = 14;
  1274.             Parent = ScreenGui;
  1275.         });
  1276.  
  1277.         ToggleLabel:GetPropertyChangedSignal('AbsolutePosition'):Connect(function()
  1278.             ModeSelectOuter.Position = UDim2.fromOffset(ToggleLabel.AbsolutePosition.X + ToggleLabel.AbsoluteSize.X + 4, ToggleLabel.AbsolutePosition.Y + 1);
  1279.         end);
  1280.  
  1281.         local ModeSelectInner = Library:Create('Frame', {
  1282.             BackgroundColor3 = Library.BackgroundColor;
  1283.             BorderColor3 = Library.OutlineColor;
  1284.             BorderMode = Enum.BorderMode.Inset;
  1285.             Size = UDim2.new(1, 0, 1, 0);
  1286.             ZIndex = 15;
  1287.             Parent = ModeSelectOuter;
  1288.         });
  1289.  
  1290.         Library:AddToRegistry(ModeSelectInner, {
  1291.             BackgroundColor3 = 'BackgroundColor';
  1292.             BorderColor3 = 'OutlineColor';
  1293.         });
  1294.  
  1295.         Library:Create('UIListLayout', {
  1296.             FillDirection = Enum.FillDirection.Vertical;
  1297.             SortOrder = Enum.SortOrder.LayoutOrder;
  1298.             Parent = ModeSelectInner;
  1299.         });
  1300.  
  1301.         local ContainerLabel = Library:CreateLabel({
  1302.             TextXAlignment = Enum.TextXAlignment.Left;
  1303.             Size = UDim2.new(1, 0, 0, 18);
  1304.             TextSize = 13;
  1305.             Visible = false;
  1306.             ZIndex = 110;
  1307.             Parent = Library.KeybindContainer;
  1308.         },  true);
  1309.  
  1310.         local Modes = Info.Modes or { 'Always', 'Toggle', 'Hold' };
  1311.         local ModeButtons = {};
  1312.  
  1313.         for Idx, Mode in next, Modes do
  1314.             local ModeButton = {};
  1315.  
  1316.             local Label = Library:CreateLabel({
  1317.                 Active = false;
  1318.                 Size = UDim2.new(1, 0, 0, 15);
  1319.                 TextSize = 13;
  1320.                 Text = Mode;
  1321.                 ZIndex = 16;
  1322.                 Parent = ModeSelectInner;
  1323.             });
  1324.  
  1325.             function ModeButton:Select()
  1326.                 for _, Button in next, ModeButtons do
  1327.                     Button:Deselect();
  1328.                 end;
  1329.  
  1330.                 KeyPicker.Mode = Mode;
  1331.  
  1332.                 Label.TextColor3 = Library.AccentColor;
  1333.                 Library.RegistryMap[Label].Properties.TextColor3 = 'AccentColor';
  1334.  
  1335.                 ModeSelectOuter.Visible = false;
  1336.             end;
  1337.  
  1338.             function ModeButton:Deselect()
  1339.                 KeyPicker.Mode = nil;
  1340.  
  1341.                 Label.TextColor3 = Library.FontColor;
  1342.                 Library.RegistryMap[Label].Properties.TextColor3 = 'FontColor';
  1343.             end;
  1344.  
  1345.             Label.InputBegan:Connect(function(Input)
  1346.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1347.                     ModeButton:Select();
  1348.                     Library:AttemptSave();
  1349.                 end;
  1350.             end);
  1351.  
  1352.             if Mode == KeyPicker.Mode then
  1353.                 ModeButton:Select();
  1354.             end;
  1355.  
  1356.             ModeButtons[Mode] = ModeButton;
  1357.         end;
  1358.  
  1359.         function KeyPicker:Update()
  1360.             if Info.NoUI then
  1361.                 return;
  1362.             end;
  1363.  
  1364.             local State = KeyPicker:GetState();
  1365.  
  1366.             ContainerLabel.Text = string.format('[%s] %s (%s)', KeyPicker.Value, Info.Text, KeyPicker.Mode);
  1367.  
  1368.             ContainerLabel.Visible = true;
  1369.             ContainerLabel.TextColor3 = State and Library.AccentColor or Library.FontColor;
  1370.  
  1371.             Library.RegistryMap[ContainerLabel].Properties.TextColor3 = State and 'AccentColor' or 'FontColor';
  1372.  
  1373.             local YSize = 0
  1374.             local XSize = 0
  1375.  
  1376.             for _, Label in next, Library.KeybindContainer:GetChildren() do
  1377.                 if Label:IsA('TextLabel') and Label.Visible then
  1378.                     YSize = YSize + 18;
  1379.                     if (Label.TextBounds.X > XSize) then
  1380.                         XSize = Label.TextBounds.X
  1381.                     end
  1382.                 end;
  1383.             end;
  1384.  
  1385.             Library.KeybindFrame.Size = UDim2.new(0, math.max(XSize + 10, 210), 0, YSize + 23)
  1386.         end;
  1387.  
  1388.         function KeyPicker:GetState()
  1389.             if KeyPicker.Mode == 'Always' then
  1390.                 return true;
  1391.             elseif KeyPicker.Mode == 'Hold' then
  1392.                 if KeyPicker.Value == 'None' then
  1393.                     return false;
  1394.                 end
  1395.  
  1396.                 local Key = KeyPicker.Value;
  1397.  
  1398.                 if Key == 'MB1' or Key == 'MB2' then
  1399.                     return Key == 'MB1' and InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
  1400.                         or Key == 'MB2' and InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2);
  1401.                 else
  1402.                     return InputService:IsKeyDown(Enum.KeyCode[KeyPicker.Value]);
  1403.                 end;
  1404.             else
  1405.                 return KeyPicker.Toggled;
  1406.             end;
  1407.         end;
  1408.  
  1409.         function KeyPicker:SetValue(Data)
  1410.             local Key, Mode = Data[1], Data[2];
  1411.             DisplayLabel.Text = Key;
  1412.             KeyPicker.Value = Key;
  1413.             if ModeButtons[Mode] then ModeButtons[Mode]:Select(); end
  1414.             KeyPicker:Update();
  1415.         end;
  1416.  
  1417.         function KeyPicker:OnClick(Callback)
  1418.             KeyPicker.Clicked = Callback
  1419.         end
  1420.  
  1421.         function KeyPicker:OnChanged(Callback)
  1422.             KeyPicker.Changed = Callback
  1423.             Callback(KeyPicker.Value)
  1424.         end
  1425.  
  1426.         if ParentObj.Addons then
  1427.             table.insert(ParentObj.Addons, KeyPicker)
  1428.         end
  1429.  
  1430.         function KeyPicker:DoClick()
  1431.             if ParentObj.Type == 'Toggle' and KeyPicker.SyncToggleState then
  1432.                 ParentObj:SetValue(not ParentObj.Value)
  1433.             end
  1434.  
  1435.             Library:SafeCallback(KeyPicker.Callback, KeyPicker.Toggled)
  1436.             Library:SafeCallback(KeyPicker.Clicked, KeyPicker.Toggled)
  1437.         end
  1438.  
  1439.         local Picking = false;
  1440.  
  1441.         PickOuter.InputBegan:Connect(function(Input)
  1442.             if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame() then
  1443.                 Picking = true;
  1444.  
  1445.                 DisplayLabel.Text = '';
  1446.  
  1447.                 local Break;
  1448.                 local Text = '';
  1449.  
  1450.                 task.spawn(function()
  1451.                     while (not Break) do
  1452.                         if Text == '...' then
  1453.                             Text = '';
  1454.                         end;
  1455.  
  1456.                         Text = Text .. '.';
  1457.                         DisplayLabel.Text = Text;
  1458.  
  1459.                         task.wait(0.4);
  1460.                     end;
  1461.                 end);
  1462.  
  1463.                 task.wait(0.2);
  1464.  
  1465.                 local Event;
  1466.                 Event = InputService.InputBegan:Connect(function(Input)
  1467.                     local Key;
  1468.  
  1469.                     if Input.UserInputType == Enum.UserInputType.Keyboard then
  1470.                         Key = Input.KeyCode.Name;
  1471.                     elseif Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1472.                         Key = 'MB1';
  1473.                     elseif Input.UserInputType == Enum.UserInputType.MouseButton2 then
  1474.                         Key = 'MB2';
  1475.                     end;
  1476.  
  1477.                     Break = true;
  1478.                     Picking = false;
  1479.  
  1480.                     DisplayLabel.Text = Key;
  1481.                     KeyPicker.Value = Key;
  1482.  
  1483.                     Library:SafeCallback(KeyPicker.ChangedCallback, Input.KeyCode or Input.UserInputType)
  1484.                     Library:SafeCallback(KeyPicker.Changed, Input.KeyCode or Input.UserInputType)
  1485.  
  1486.                     Library:AttemptSave();
  1487.  
  1488.                     Event:Disconnect();
  1489.                 end);
  1490.             elseif Input.UserInputType == Enum.UserInputType.MouseButton2 and not Library:MouseIsOverOpenedFrame() then
  1491.                 ModeSelectOuter.Visible = true;
  1492.             end;
  1493.         end);
  1494.  
  1495.         Library:GiveSignal(InputService.InputBegan:Connect(function(Input)
  1496.             if KeyPicker.Value == "Unknown" then return end
  1497.        
  1498.             if (not Picking) and (not InputService:GetFocusedTextBox()) then
  1499.                 if KeyPicker.Mode == 'Toggle' then
  1500.                     local Key = KeyPicker.Value;
  1501.  
  1502.                     if Key == 'MB1' or Key == 'MB2' then
  1503.                         if Key == 'MB1' and Input.UserInputType == Enum.UserInputType.MouseButton1
  1504.                         or Key == 'MB2' and Input.UserInputType == Enum.UserInputType.MouseButton2 then
  1505.                             KeyPicker.Toggled = not KeyPicker.Toggled
  1506.                             KeyPicker:DoClick()
  1507.                         end;
  1508.                     elseif Input.UserInputType == Enum.UserInputType.Keyboard then
  1509.                         if Input.KeyCode.Name == Key then
  1510.                             KeyPicker.Toggled = not KeyPicker.Toggled;
  1511.                             KeyPicker:DoClick()
  1512.                         end;
  1513.                     end;
  1514.                 end;
  1515.  
  1516.                 KeyPicker:Update();
  1517.             end;
  1518.  
  1519.             if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1520.                 local AbsPos, AbsSize = ModeSelectOuter.AbsolutePosition, ModeSelectOuter.AbsoluteSize;
  1521.  
  1522.                 if Mouse.X < AbsPos.X or Mouse.X > AbsPos.X + AbsSize.X
  1523.                     or Mouse.Y < (AbsPos.Y - 20 - 1) or Mouse.Y > AbsPos.Y + AbsSize.Y then
  1524.  
  1525.                     ModeSelectOuter.Visible = false;
  1526.                 end;
  1527.             end;
  1528.         end))
  1529.  
  1530.         Library:GiveSignal(InputService.InputEnded:Connect(function(Input)
  1531.             if (not Picking) then
  1532.                 KeyPicker:Update();
  1533.             end;
  1534.         end))
  1535.  
  1536.         KeyPicker:Update();
  1537.         KeyPicker.DisplayFrame = PickOuter
  1538.  
  1539.         Options[Idx] = KeyPicker;
  1540.  
  1541.         return self;
  1542.     end;
  1543.  
  1544.     BaseAddons.__index = Funcs;
  1545.     BaseAddons.__namecall = function(Table, Key, ...)
  1546.         return Funcs[Key](...);
  1547.     end;
  1548. end;
  1549.  
  1550. local BaseGroupbox = {};
  1551.  
  1552. do
  1553.     local Funcs = {};
  1554.  
  1555.     function Funcs:AddBlank(Size)
  1556.         local Groupbox = self;
  1557.         local Container = Groupbox.Container;
  1558.  
  1559.         Library:Create('Frame', {
  1560.             BackgroundTransparency = 1;
  1561.             Size = UDim2.new(1, 0, 0, Size);
  1562.             ZIndex = 1;
  1563.             Parent = Container;
  1564.         });
  1565.     end;
  1566.  
  1567.     function Funcs:AddLabel(Text, DoesWrap)
  1568.         local Label = {};
  1569.  
  1570.         local Groupbox = self;
  1571.         local Container = Groupbox.Container;
  1572.  
  1573.         local TextLabel = Library:CreateLabel({
  1574.             Size = UDim2.new(1, -4, 0, 15);
  1575.             TextSize = 14;
  1576.             Text = Text;
  1577.             TextWrapped = DoesWrap or false,
  1578.             TextXAlignment = Enum.TextXAlignment.Left;
  1579.             ZIndex = 5;
  1580.             Parent = Container;
  1581.         });
  1582.  
  1583.         if DoesWrap then
  1584.             local Y = select(2, Library:GetTextBounds(Text, Library.Font, 14, Vector2.new(TextLabel.AbsoluteSize.X, math.huge)))
  1585.             TextLabel.Size = UDim2.new(1, -4, 0, Y)
  1586.         else
  1587.             Library:Create('UIListLayout', {
  1588.                 Padding = UDim.new(0, 4);
  1589.                 FillDirection = Enum.FillDirection.Horizontal;
  1590.                 HorizontalAlignment = Enum.HorizontalAlignment.Right;
  1591.                 SortOrder = Enum.SortOrder.LayoutOrder;
  1592.                 Parent = TextLabel;
  1593.             });
  1594.         end
  1595.  
  1596.         Label.TextLabel = TextLabel;
  1597.         Label.Container = Container;
  1598.  
  1599.         function Label:SetText(Text)
  1600.             TextLabel.Text = Text
  1601.  
  1602.             if DoesWrap then
  1603.                 local Y = select(2, Library:GetTextBounds(Text, Library.Font, 14, Vector2.new(TextLabel.AbsoluteSize.X, math.huge)))
  1604.                 TextLabel.Size = UDim2.new(1, -4, 0, Y)
  1605.             end
  1606.  
  1607.             Groupbox:Resize();
  1608.         end
  1609.  
  1610.         if (not DoesWrap) then
  1611.             setmetatable(Label, BaseAddons);
  1612.         end
  1613.  
  1614.         Groupbox:AddBlank(5);
  1615.         Groupbox:Resize();
  1616.  
  1617.         return Label;
  1618.     end;
  1619.  
  1620.     function Funcs:AddButton(...)
  1621.         -- TODO: Eventually redo this
  1622.         local Button = {};
  1623.         local function ProcessButtonParams(Class, Obj, ...)
  1624.             local Props = select(1, ...)
  1625.             if type(Props) == 'table' then
  1626.                 Obj.Text = Props.Text
  1627.                 Obj.Func = Props.Func
  1628.                 Obj.DoubleClick = Props.DoubleClick
  1629.                 Obj.Tooltip = Props.Tooltip
  1630.             else
  1631.                 Obj.Text = select(1, ...)
  1632.                 Obj.Func = select(2, ...)
  1633.             end
  1634.  
  1635.             assert(type(Obj.Func) == 'function', 'AddButton: `Func` callback is missing.');
  1636.         end
  1637.  
  1638.         ProcessButtonParams('Button', Button, ...)
  1639.  
  1640.         local Groupbox = self;
  1641.         local Container = Groupbox.Container;
  1642.  
  1643.         local function CreateBaseButton(Button)
  1644.             local Outer = Library:Create('Frame', {
  1645.                 BackgroundColor3 = Color3.new(0, 0, 0);
  1646.                 BorderColor3 = Color3.new(0, 0, 0);
  1647.                 Size = UDim2.new(1, -4, 0, 20);
  1648.                 ZIndex = 5;
  1649.             });
  1650.  
  1651.             local Inner = Library:Create('Frame', {
  1652.                 BackgroundColor3 = Library.MainColor;
  1653.                 BorderColor3 = Library.OutlineColor;
  1654.                 BorderMode = Enum.BorderMode.Inset;
  1655.                 Size = UDim2.new(1, 0, 1, 0);
  1656.                 ZIndex = 6;
  1657.                 Parent = Outer;
  1658.             });
  1659.  
  1660.             local Label = Library:CreateLabel({
  1661.                 Size = UDim2.new(1, 0, 1, 0);
  1662.                 TextSize = 14;
  1663.                 Text = Button.Text;
  1664.                 ZIndex = 6;
  1665.                 Parent = Inner;
  1666.             });
  1667.  
  1668.             Library:Create('UIGradient', {
  1669.                 Color = ColorSequence.new({
  1670.                     ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  1671.                     ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  1672.                 });
  1673.                 Rotation = 90;
  1674.                 Parent = Inner;
  1675.             });
  1676.  
  1677.             Library:AddToRegistry(Outer, {
  1678.                 BorderColor3 = 'Black';
  1679.             });
  1680.  
  1681.             Library:AddToRegistry(Inner, {
  1682.                 BackgroundColor3 = 'MainColor';
  1683.                 BorderColor3 = 'OutlineColor';
  1684.             });
  1685.  
  1686.             Library:OnHighlight(Outer, Outer,
  1687.                 { BorderColor3 = 'AccentColor' },
  1688.                 { BorderColor3 = 'Black' }
  1689.             );
  1690.  
  1691.             return Outer, Inner, Label
  1692.         end
  1693.  
  1694.         local function InitEvents(Button)
  1695.             local function WaitForEvent(event, timeout, validator)
  1696.                 local bindable = Instance.new('BindableEvent')
  1697.                 local connection = event:Once(function(...)
  1698.  
  1699.                     if type(validator) == 'function' and validator(...) then
  1700.                         bindable:Fire(true)
  1701.                     else
  1702.                         bindable:Fire(false)
  1703.                     end
  1704.                 end)
  1705.                 task.delay(timeout, function()
  1706.                     connection:disconnect()
  1707.                     bindable:Fire(false)
  1708.                 end)
  1709.                 return bindable.Event:Wait()
  1710.             end
  1711.  
  1712.             local function ValidateClick(Input)
  1713.                 if Library:MouseIsOverOpenedFrame(Input) then
  1714.                     return false
  1715.                 end
  1716.  
  1717.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1718.                     return true
  1719.                 elseif Input.UserInputType == Enum.UserInputType.Touch then
  1720.                     return true
  1721.                 else
  1722.                     return false
  1723.                 end
  1724.             end
  1725.  
  1726.             Button.Outer.InputBegan:Connect(function(Input)
  1727.                 if not ValidateClick(Input) then return end
  1728.                 if Button.Locked then return end
  1729.  
  1730.                 if Button.DoubleClick then
  1731.                     Library:RemoveFromRegistry(Button.Label)
  1732.                     Library:AddToRegistry(Button.Label, { TextColor3 = 'AccentColor' })
  1733.  
  1734.                     Button.Label.TextColor3 = Library.AccentColor
  1735.                     Button.Label.Text = 'Are you sure?'
  1736.                     Button.Locked = true
  1737.  
  1738.                     local clicked = WaitForEvent(Button.Outer.InputBegan, 0.5, ValidateClick)
  1739.  
  1740.                     Library:RemoveFromRegistry(Button.Label)
  1741.                     Library:AddToRegistry(Button.Label, { TextColor3 = 'FontColor' })
  1742.  
  1743.                     Button.Label.TextColor3 = Library.FontColor
  1744.                     Button.Label.Text = Button.Text
  1745.                     task.defer(rawset, Button, 'Locked', false)
  1746.  
  1747.                     if clicked then
  1748.                         Library:SafeCallback(Button.Func)
  1749.                     end
  1750.  
  1751.                     return
  1752.                 end
  1753.  
  1754.                 Library:SafeCallback(Button.Func);
  1755.             end)
  1756.         end
  1757.  
  1758.         Button.Outer, Button.Inner, Button.Label = CreateBaseButton(Button)
  1759.         Button.Outer.Parent = Container
  1760.  
  1761.         InitEvents(Button)
  1762.  
  1763.         function Button:AddTooltip(tooltip)
  1764.             if type(tooltip) == 'string' then
  1765.                 Library:AddToolTip(tooltip, self.Outer)
  1766.             end
  1767.             return self
  1768.         end
  1769.  
  1770.  
  1771.         function Button:AddButton(...)
  1772.             local SubButton = {}
  1773.  
  1774.             ProcessButtonParams('SubButton', SubButton, ...)
  1775.  
  1776.             self.Outer.Size = UDim2.new(0.5, -2, 0, 20)
  1777.  
  1778.             SubButton.Outer, SubButton.Inner, SubButton.Label = CreateBaseButton(SubButton)
  1779.  
  1780.             SubButton.Outer.Position = UDim2.new(1, 3, 0, 0)
  1781.             SubButton.Outer.Size = UDim2.new(1, -3, 1, 0)--UDim2.fromOffset(self.Outer.AbsoluteSize.X - 2, self.Outer.AbsoluteSize.Y)
  1782.             SubButton.Outer.Parent = self.Outer
  1783.  
  1784.             function SubButton:AddTooltip(tooltip)
  1785.                 if type(tooltip) == 'string' then
  1786.                     Library:AddToolTip(tooltip, self.Outer)
  1787.                 end
  1788.                 return SubButton
  1789.             end
  1790.  
  1791.             if type(SubButton.Tooltip) == 'string' then
  1792.                 SubButton:AddTooltip(SubButton.Tooltip)
  1793.             end
  1794.  
  1795.             InitEvents(SubButton)
  1796.             return SubButton
  1797.         end
  1798.  
  1799.         if type(Button.Tooltip) == 'string' then
  1800.             Button:AddTooltip(Button.Tooltip)
  1801.         end
  1802.  
  1803.         Groupbox:AddBlank(5);
  1804.         Groupbox:Resize();
  1805.  
  1806.         return Button;
  1807.     end;
  1808.  
  1809.     function Funcs:AddDivider()
  1810.         local Groupbox = self;
  1811.         local Container = self.Container
  1812.  
  1813.         local Divider = {
  1814.             Type = 'Divider',
  1815.         }
  1816.  
  1817.         Groupbox:AddBlank(2);
  1818.         local DividerOuter = Library:Create('Frame', {
  1819.             BackgroundColor3 = Color3.new(0, 0, 0);
  1820.             BorderColor3 = Color3.new(0, 0, 0);
  1821.             Size = UDim2.new(1, -4, 0, 5);
  1822.             ZIndex = 5;
  1823.             Parent = Container;
  1824.         });
  1825.  
  1826.         local DividerInner = Library:Create('Frame', {
  1827.             BackgroundColor3 = Library.MainColor;
  1828.             BorderColor3 = Library.OutlineColor;
  1829.             BorderMode = Enum.BorderMode.Inset;
  1830.             Size = UDim2.new(1, 0, 1, 0);
  1831.             ZIndex = 6;
  1832.             Parent = DividerOuter;
  1833.         });
  1834.  
  1835.         Library:AddToRegistry(DividerOuter, {
  1836.             BorderColor3 = 'Black';
  1837.         });
  1838.  
  1839.         Library:AddToRegistry(DividerInner, {
  1840.             BackgroundColor3 = 'MainColor';
  1841.             BorderColor3 = 'OutlineColor';
  1842.         });
  1843.  
  1844.         Groupbox:AddBlank(9);
  1845.         Groupbox:Resize();
  1846.     end
  1847.  
  1848.     function Funcs:AddInput(Idx, Info)
  1849.         assert(Info.Text, 'AddInput: Missing `Text` string.')
  1850.  
  1851.         local Textbox = {
  1852.             Value = Info.Default or '';
  1853.             Numeric = Info.Numeric or false;
  1854.             Finished = Info.Finished or false;
  1855.             Type = 'Input';
  1856.             Callback = Info.Callback or function(Value) end;
  1857.         };
  1858.  
  1859.         local Groupbox = self;
  1860.         local Container = Groupbox.Container;
  1861.  
  1862.         local InputLabel = Library:CreateLabel({
  1863.             Size = UDim2.new(1, 0, 0, 15);
  1864.             TextSize = 14;
  1865.             Text = Info.Text;
  1866.             TextXAlignment = Enum.TextXAlignment.Left;
  1867.             ZIndex = 5;
  1868.             Parent = Container;
  1869.         });
  1870.  
  1871.         Groupbox:AddBlank(1);
  1872.  
  1873.         local TextBoxOuter = Library:Create('Frame', {
  1874.             BackgroundColor3 = Color3.new(0, 0, 0);
  1875.             BorderColor3 = Color3.new(0, 0, 0);
  1876.             Size = UDim2.new(1, -4, 0, 20);
  1877.             ZIndex = 5;
  1878.             Parent = Container;
  1879.         });
  1880.  
  1881.         local TextBoxInner = Library:Create('Frame', {
  1882.             BackgroundColor3 = Library.MainColor;
  1883.             BorderColor3 = Library.OutlineColor;
  1884.             BorderMode = Enum.BorderMode.Inset;
  1885.             Size = UDim2.new(1, 0, 1, 0);
  1886.             ZIndex = 6;
  1887.             Parent = TextBoxOuter;
  1888.         });
  1889.  
  1890.         Library:AddToRegistry(TextBoxInner, {
  1891.             BackgroundColor3 = 'MainColor';
  1892.             BorderColor3 = 'OutlineColor';
  1893.         });
  1894.  
  1895.         Library:OnHighlight(TextBoxOuter, TextBoxOuter,
  1896.             { BorderColor3 = 'AccentColor' },
  1897.             { BorderColor3 = 'Black' }
  1898.         );
  1899.  
  1900.         if type(Info.Tooltip) == 'string' then
  1901.             Library:AddToolTip(Info.Tooltip, TextBoxOuter)
  1902.         end
  1903.  
  1904.         Library:Create('UIGradient', {
  1905.             Color = ColorSequence.new({
  1906.                 ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  1907.                 ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  1908.             });
  1909.             Rotation = 90;
  1910.             Parent = TextBoxInner;
  1911.         });
  1912.  
  1913.         local Container = Library:Create('Frame', {
  1914.             BackgroundTransparency = 1;
  1915.             ClipsDescendants = true;
  1916.  
  1917.             Position = UDim2.new(0, 5, 0, 0);
  1918.             Size = UDim2.new(1, -5, 1, 0);
  1919.  
  1920.             ZIndex = 7;
  1921.             Parent = TextBoxInner;
  1922.         })
  1923.  
  1924.         local Box = Library:Create('TextBox', {
  1925.             BackgroundTransparency = 1;
  1926.  
  1927.             Position = UDim2.fromOffset(0, 0),
  1928.             Size = UDim2.fromScale(5, 1),
  1929.  
  1930.             Font = Library.Font;
  1931.             PlaceholderColor3 = Color3.fromRGB(190, 190, 190);
  1932.             PlaceholderText = Info.Placeholder or '';
  1933.  
  1934.             Text = Info.Default or '';
  1935.             TextColor3 = Library.FontColor;
  1936.             TextSize = 14;
  1937.             TextStrokeTransparency = 0;
  1938.             TextXAlignment = Enum.TextXAlignment.Left;
  1939.  
  1940.             ClearTextOnFocus = (typeof(Info.ClearTextOnFocus) ~= "boolean" and true or Info.ClearTextOnFocus);
  1941.  
  1942.             ZIndex = 7;
  1943.             Parent = Container;
  1944.         });
  1945.  
  1946.         Library:ApplyTextStroke(Box);
  1947.  
  1948.         function Textbox:SetValue(Text)
  1949.             if Info.MaxLength and #Text > Info.MaxLength then
  1950.                 Text = Text:sub(1, Info.MaxLength);
  1951.             end;
  1952.  
  1953.             if Textbox.Numeric then
  1954.                 if (not tonumber(Text)) and Text:len() > 0 then
  1955.                     Text = Textbox.Value
  1956.                 end
  1957.             end
  1958.  
  1959.             Textbox.Value = Text;
  1960.             Box.Text = Text;
  1961.  
  1962.             Library:SafeCallback(Textbox.Callback, Textbox.Value);
  1963.             Library:SafeCallback(Textbox.Changed, Textbox.Value);
  1964.         end;
  1965.  
  1966.         if Textbox.Finished then
  1967.             Box.FocusLost:Connect(function(enter)
  1968.                 if not enter then return end
  1969.  
  1970.                 Textbox:SetValue(Box.Text);
  1971.                 Library:AttemptSave();
  1972.             end)
  1973.         else
  1974.             Box:GetPropertyChangedSignal('Text'):Connect(function()
  1975.                 Textbox:SetValue(Box.Text);
  1976.                 Library:AttemptSave();
  1977.             end);
  1978.         end
  1979.  
  1980.         -- https://devforum.roblox.com/t/how-to-make-textboxes-follow-current-cursor-position/1368429/6
  1981.         -- thank you nicemike40 :)
  1982.  
  1983.         local function Update()
  1984.             local PADDING = 2
  1985.             local reveal = Container.AbsoluteSize.X
  1986.  
  1987.             if not Box:IsFocused() or Box.TextBounds.X <= reveal - 2 * PADDING then
  1988.                 -- we aren't focused, or we fit so be normal
  1989.                 Box.Position = UDim2.new(0, PADDING, 0, 0)
  1990.             else
  1991.                 -- we are focused and don't fit, so adjust position
  1992.                 local cursor = Box.CursorPosition
  1993.                 if cursor ~= -1 then
  1994.                     -- calculate pixel width of text from start to cursor
  1995.                     local subtext = string.sub(Box.Text, 1, cursor-1)
  1996.                     local width = TextService:GetTextSize(subtext, Box.TextSize, Box.Font, Vector2.new(math.huge, math.huge)).X
  1997.  
  1998.                     -- check if we're inside the box with the cursor
  1999.                     local currentCursorPos = Box.Position.X.Offset + width
  2000.  
  2001.                     -- adjust if necessary
  2002.                     if currentCursorPos < PADDING then
  2003.                         Box.Position = UDim2.fromOffset(PADDING-width, 0)
  2004.                     elseif currentCursorPos > reveal - PADDING - 1 then
  2005.                         Box.Position = UDim2.fromOffset(reveal-width-PADDING-1, 0)
  2006.                     end
  2007.                 end
  2008.             end
  2009.         end
  2010.  
  2011.         task.spawn(Update)
  2012.  
  2013.         Box:GetPropertyChangedSignal('Text'):Connect(Update)
  2014.         Box:GetPropertyChangedSignal('CursorPosition'):Connect(Update)
  2015.         Box.FocusLost:Connect(Update)
  2016.         Box.Focused:Connect(Update)
  2017.  
  2018.         Library:AddToRegistry(Box, {
  2019.             TextColor3 = 'FontColor';
  2020.         });
  2021.  
  2022.         function Textbox:OnChanged(Func)
  2023.             Textbox.Changed = Func;
  2024.             Func(Textbox.Value);
  2025.         end;
  2026.  
  2027.         Groupbox:AddBlank(5);
  2028.         Groupbox:Resize();
  2029.  
  2030.         Options[Idx] = Textbox;
  2031.  
  2032.         return Textbox;
  2033.     end;
  2034.  
  2035.     function Funcs:AddToggle(Idx, Info)
  2036.         assert(Info.Text, 'AddInput: Missing `Text` string.')
  2037.  
  2038.         local Toggle = {
  2039.             Value = Info.Default or false;
  2040.             Type = 'Toggle';
  2041.  
  2042.             Callback = Info.Callback or function(Value) end;
  2043.             Addons = {},
  2044.             Risky = Info.Risky,
  2045.         };
  2046.  
  2047.         local Groupbox = self;
  2048.         local Container = Groupbox.Container;
  2049.  
  2050.         local ToggleOuter = Library:Create('Frame', {
  2051.             BackgroundColor3 = Color3.new(0, 0, 0);
  2052.             BorderColor3 = Color3.new(0, 0, 0);
  2053.             Size = UDim2.new(0, 13, 0, 13);
  2054.             ZIndex = 5;
  2055.             Parent = Container;
  2056.         });
  2057.  
  2058.         Library:AddToRegistry(ToggleOuter, {
  2059.             BorderColor3 = 'Black';
  2060.         });
  2061.  
  2062.         local ToggleInner = Library:Create('Frame', {
  2063.             BackgroundColor3 = Library.MainColor;
  2064.             BorderColor3 = Library.OutlineColor;
  2065.             BorderMode = Enum.BorderMode.Inset;
  2066.             Size = UDim2.new(1, 0, 1, 0);
  2067.             ZIndex = 6;
  2068.             Parent = ToggleOuter;
  2069.         });
  2070.  
  2071.         Library:AddToRegistry(ToggleInner, {
  2072.             BackgroundColor3 = 'MainColor';
  2073.             BorderColor3 = 'OutlineColor';
  2074.         });
  2075.  
  2076.         local ToggleLabel = Library:CreateLabel({
  2077.             Size = UDim2.new(0, 216, 1, 0);
  2078.             Position = UDim2.new(1, 6, 0, -1);
  2079.             TextSize = 14;
  2080.             Text = Info.Text;
  2081.             TextXAlignment = Enum.TextXAlignment.Left;
  2082.             ZIndex = 6;
  2083.             Parent = ToggleInner;
  2084.         });
  2085.  
  2086.         Library:Create('UIListLayout', {
  2087.             Padding = UDim.new(0, 4);
  2088.             FillDirection = Enum.FillDirection.Horizontal;
  2089.             HorizontalAlignment = Enum.HorizontalAlignment.Right;
  2090.             SortOrder = Enum.SortOrder.LayoutOrder;
  2091.             Parent = ToggleLabel;
  2092.         });
  2093.  
  2094.         local ToggleRegion = Library:Create('Frame', {
  2095.             BackgroundTransparency = 1;
  2096.             Size = UDim2.new(0, 170, 1, 0);
  2097.             ZIndex = 8;
  2098.             Parent = ToggleOuter;
  2099.         });
  2100.  
  2101.         Library:OnHighlight(ToggleRegion, ToggleOuter,
  2102.             { BorderColor3 = 'AccentColor' },
  2103.             { BorderColor3 = 'Black' },
  2104.             function()
  2105.                 for _, Addon in next, Toggle.Addons do
  2106.                     if Library:MouseIsOverFrame(Addon.DisplayFrame) then return false end
  2107.                 end
  2108.                 return true
  2109.             end
  2110.         );
  2111.  
  2112.         function Toggle:UpdateColors()
  2113.             Toggle:Display();
  2114.         end;
  2115.  
  2116.         if type(Info.Tooltip) == 'string' then
  2117.             Library:AddToolTip(Info.Tooltip, ToggleRegion)
  2118.         end
  2119.  
  2120.         function Toggle:Display()
  2121.             if IsKrampus or setthreadcaps then setthreadcaps(8) end
  2122.             ToggleInner.BackgroundColor3 = Toggle.Value and Library.AccentColor or Library.MainColor;
  2123.             ToggleInner.BorderColor3 = Toggle.Value and Library.AccentColorDark or Library.OutlineColor;
  2124.  
  2125.             Library.RegistryMap[ToggleInner].Properties.BackgroundColor3 = Toggle.Value and 'AccentColor' or 'MainColor';
  2126.             Library.RegistryMap[ToggleInner].Properties.BorderColor3 = Toggle.Value and 'AccentColorDark' or 'OutlineColor';
  2127.         end;
  2128.  
  2129.         function Toggle:OnChanged(Func)
  2130.             Toggle.Changed = Func;
  2131.             Func(Toggle.Value);
  2132.         end;
  2133.  
  2134.         function Toggle:SetValue(Bool)
  2135.             Bool = (not not Bool);
  2136.  
  2137.             Toggle.Value = Bool;
  2138.             Toggle:Display();
  2139.  
  2140.             for _, Addon in next, Toggle.Addons do
  2141.                 if Addon.Type == 'KeyPicker' and Addon.SyncToggleState then
  2142.                     Addon.Toggled = Bool
  2143.                     Addon:Update()
  2144.                 end
  2145.             end
  2146.  
  2147.             Library:SafeCallback(Toggle.Callback, Toggle.Value);
  2148.             Library:SafeCallback(Toggle.Changed, Toggle.Value);
  2149.             Library:UpdateDependencyBoxes();
  2150.         end;
  2151.  
  2152.         ToggleRegion.InputBegan:Connect(function(Input)
  2153.             if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame()) or Input.UserInputType == Enum.UserInputType.Touch then
  2154.                 for _, Addon in next, Toggle.Addons do
  2155.                     if Library:MouseIsOverFrame(Addon.DisplayFrame) then return end
  2156.                 end
  2157.                 Toggle:SetValue(not Toggle.Value) -- Why was it not like this from the start?
  2158.                 Library:AttemptSave();
  2159.             end;
  2160.         end);
  2161.  
  2162.         if Toggle.Risky then
  2163.             Library:RemoveFromRegistry(ToggleLabel)
  2164.             ToggleLabel.TextColor3 = Library.RiskColor
  2165.             Library:AddToRegistry(ToggleLabel, { TextColor3 = 'RiskColor' })
  2166.         end
  2167.  
  2168.         Toggle:Display();
  2169.         Groupbox:AddBlank(Info.BlankSize or 5 + 2);
  2170.         Groupbox:Resize();
  2171.  
  2172.         Toggle.TextLabel = ToggleLabel;
  2173.         Toggle.Container = Container;
  2174.         setmetatable(Toggle, BaseAddons);
  2175.  
  2176.         Toggles[Idx] = Toggle;
  2177.  
  2178.         Library:UpdateDependencyBoxes();
  2179.  
  2180.         return Toggle;
  2181.     end;
  2182.  
  2183.     function Funcs:AddSlider(Idx, Info)
  2184.         assert(Info.Default, 'AddSlider: Missing default value.');
  2185.         assert(Info.Text, 'AddSlider: Missing slider text.');
  2186.         assert(Info.Min, 'AddSlider: Missing minimum value.');
  2187.         assert(Info.Max, 'AddSlider: Missing maximum value.');
  2188.         assert(Info.Rounding, 'AddSlider: Missing rounding value.');
  2189.  
  2190.         local Slider = {
  2191.             Value = Info.Default;
  2192.             Min = Info.Min;
  2193.             Max = Info.Max;
  2194.             Rounding = Info.Rounding;
  2195.             MaxSize = 232;
  2196.             Type = 'Slider';
  2197.             Callback = Info.Callback or function(Value) end;
  2198.         };
  2199.  
  2200.         local Groupbox = self;
  2201.         local Container = Groupbox.Container;
  2202.  
  2203.         if not Info.Compact then
  2204.             Library:CreateLabel({
  2205.                 Size = UDim2.new(1, 0, 0, 10);
  2206.                 TextSize = 14;
  2207.                 Text = Info.Text;
  2208.                 TextXAlignment = Enum.TextXAlignment.Left;
  2209.                 TextYAlignment = Enum.TextYAlignment.Bottom;
  2210.                 ZIndex = 5;
  2211.                 Parent = Container;
  2212.             });
  2213.  
  2214.             Groupbox:AddBlank(3);
  2215.         end
  2216.  
  2217.         local SliderOuter = Library:Create('Frame', {
  2218.             BackgroundColor3 = Color3.new(0, 0, 0);
  2219.             BorderColor3 = Color3.new(0, 0, 0);
  2220.             Size = UDim2.new(1, -4, 0, 13);
  2221.             ZIndex = 5;
  2222.             Parent = Container;
  2223.         });
  2224.  
  2225.         SliderOuter:GetPropertyChangedSignal('AbsoluteSize'):Connect(function()
  2226.             Slider.MaxSize = SliderOuter.AbsoluteSize.X - 2;
  2227.         end);
  2228.  
  2229.         Library:AddToRegistry(SliderOuter, {
  2230.             BorderColor3 = 'Black';
  2231.         });
  2232.  
  2233.         local SliderInner = Library:Create('Frame', {
  2234.             BackgroundColor3 = Library.MainColor;
  2235.             BorderColor3 = Library.OutlineColor;
  2236.             BorderMode = Enum.BorderMode.Inset;
  2237.             Size = UDim2.new(1, 0, 1, 0);
  2238.             ZIndex = 6;
  2239.             Parent = SliderOuter;
  2240.         });
  2241.  
  2242.         Library:AddToRegistry(SliderInner, {
  2243.             BackgroundColor3 = 'MainColor';
  2244.             BorderColor3 = 'OutlineColor';
  2245.         });
  2246.  
  2247.         local Fill = Library:Create('Frame', {
  2248.             BackgroundColor3 = Library.AccentColor;
  2249.             BorderColor3 = Library.AccentColorDark;
  2250.             Size = UDim2.new(0, 0, 1, 0);
  2251.             ZIndex = 7;
  2252.             Parent = SliderInner;
  2253.         });
  2254.  
  2255.         Library:AddToRegistry(Fill, {
  2256.             BackgroundColor3 = 'AccentColor';
  2257.             BorderColor3 = 'AccentColorDark';
  2258.         });
  2259.  
  2260.         local HideBorderRight = Library:Create('Frame', {
  2261.             BackgroundColor3 = Library.AccentColor;
  2262.             BorderSizePixel = 0;
  2263.             Position = UDim2.new(1, 0, 0, 0);
  2264.             Size = UDim2.new(0, 1, 1, 0);
  2265.             ZIndex = 8;
  2266.             Parent = Fill;
  2267.         });
  2268.  
  2269.         Library:AddToRegistry(HideBorderRight, {
  2270.             BackgroundColor3 = 'AccentColor';
  2271.         });
  2272.  
  2273.         local DisplayLabel = Library:CreateLabel({
  2274.             Size = UDim2.new(1, 0, 1, 0);
  2275.             TextSize = 14;
  2276.             Text = 'Infinite';
  2277.             ZIndex = 9;
  2278.             Parent = SliderInner;
  2279.         });
  2280.  
  2281.         Library:OnHighlight(SliderOuter, SliderOuter,
  2282.             { BorderColor3 = 'AccentColor' },
  2283.             { BorderColor3 = 'Black' }
  2284.         );
  2285.  
  2286.         if type(Info.Tooltip) == 'string' then
  2287.             Library:AddToolTip(Info.Tooltip, SliderOuter)
  2288.         end
  2289.  
  2290.         function Slider:UpdateColors()
  2291.             Fill.BackgroundColor3 = Library.AccentColor;
  2292.             Fill.BorderColor3 = Library.AccentColorDark;
  2293.         end;
  2294.        
  2295.         function Slider:Display()
  2296.             local Suffix = Info.Suffix or '';
  2297.  
  2298.             if Info.Compact then
  2299.                 DisplayLabel.Text = Info.Text .. ': ' .. Slider.Value .. Suffix
  2300.             elseif Info.HideMax then
  2301.                 DisplayLabel.Text = string.format('%s', Slider.Value .. Suffix)
  2302.             else
  2303.                 DisplayLabel.Text = string.format('%s/%s', Slider.Value .. Suffix, Slider.Max .. Suffix);
  2304.             end
  2305.  
  2306.             local X = Library:MapValue(Slider.Value, Slider.Min, Slider.Max, 0, 1);
  2307.             Fill.Size = UDim2.new(X, 0, 1, 0);
  2308.  
  2309.             -- I have no idea what this is
  2310.             HideBorderRight.Visible = not (X == 1 or X == 0);
  2311.         end;
  2312.  
  2313.         function Slider:OnChanged(Func)
  2314.             Slider.Changed = Func;
  2315.             Func(Slider.Value);
  2316.         end;
  2317.  
  2318.         local function Round(Value)
  2319.             if Slider.Rounding == 0 then
  2320.                 return math.floor(Value);
  2321.             end;
  2322.  
  2323.             return tonumber(string.format('%.' .. Slider.Rounding .. 'f', Value))
  2324.         end;
  2325.  
  2326.         function Slider:GetValueFromXScale(X)
  2327.             return Round(Library:MapValue(X, 0, 1, Slider.Min, Slider.Max));
  2328.         end;
  2329.        
  2330.         function Slider:SetMax(Value)
  2331.             assert(Value > Slider.Min, 'Max value cannot be less than the current min value.');
  2332.            
  2333.             Slider.Value = math.clamp(Slider.Value, Slider.Min, Value);
  2334.             Slider.Max = Value;
  2335.             Slider:Display();
  2336.         end;
  2337.        
  2338.         function Slider:SetMin(Value)
  2339.             assert(Value < Slider.Max, 'Min value cannot be greater than the current max value.');
  2340.  
  2341.             Slider.Value = math.clamp(Slider.Value, Value, Slider.Max);
  2342.             Slider.Min = Value;
  2343.             Slider:Display();
  2344.         end;
  2345.  
  2346.         function Slider:SetValue(Str)
  2347.             local Num = tonumber(Str);
  2348.  
  2349.             if (not Num) then
  2350.                 return;
  2351.             end;
  2352.  
  2353.             Num = math.clamp(Num, Slider.Min, Slider.Max);
  2354.  
  2355.             Slider.Value = Num;
  2356.             Slider:Display();
  2357.  
  2358.             Library:SafeCallback(Slider.Callback, Slider.Value);
  2359.             Library:SafeCallback(Slider.Changed, Slider.Value);
  2360.         end;
  2361.  
  2362.         SliderInner.InputBegan:Connect(function(Input)
  2363.             if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame()) or Input.UserInputType == Enum.UserInputType.Touch then
  2364.                 if Library.IsMobile then
  2365.                     Library.CanDrag = false;
  2366.                 end;
  2367.  
  2368.                 local Sides = {};
  2369.                 if Library.Window then
  2370.                     Sides = Library.Window.Tabs[Library.ActiveTab]:GetSides();
  2371.                 end
  2372.  
  2373.                 for _, Side in pairs(Sides) do
  2374.                     if typeof(Side) == "Instance" then
  2375.                         if Side:IsA("ScrollingFrame") then
  2376.                             Side.ScrollingEnabled = false;
  2377.                         end
  2378.                     end;
  2379.                 end;
  2380.  
  2381.                 local mPos = Mouse.X;
  2382.                 local gPos = Fill.AbsoluteSize.X;
  2383.                 local Diff = mPos - (Fill.AbsolutePosition.X + gPos);
  2384.  
  2385.                 while InputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch) do
  2386.                     local nMPos = Mouse.X;
  2387.                     local nXOffset = math.clamp(gPos + (nMPos - mPos) + Diff, 0, Slider.MaxSize); -- what in tarnation are these variable names
  2388.                     local nXScale = Library:MapValue(nXOffset, 0, Slider.MaxSize, 0, 1);
  2389.  
  2390.                     local nValue = Slider:GetValueFromXScale(nXScale);
  2391.                     local OldValue = Slider.Value;
  2392.                     Slider.Value = nValue;
  2393.  
  2394.                     Slider:Display();
  2395.  
  2396.                     if nValue ~= OldValue then
  2397.                         Library:SafeCallback(Slider.Callback, Slider.Value);
  2398.                         Library:SafeCallback(Slider.Changed, Slider.Value);
  2399.                     end;
  2400.  
  2401.                     RenderStepped:Wait();
  2402.                 end;
  2403.  
  2404.                 if Library.IsMobile then
  2405.                     Library.CanDrag = true;
  2406.                 end;
  2407.                
  2408.                 for _, Side in pairs(Sides) do
  2409.                     if typeof(Side) == "Instance" then
  2410.                         if Side:IsA("ScrollingFrame") then
  2411.                             Side.ScrollingEnabled = true;
  2412.                         end
  2413.                     end;
  2414.                 end;
  2415.  
  2416.                 Library:AttemptSave();
  2417.             end;
  2418.         end);
  2419.  
  2420.         Slider:Display();
  2421.         Groupbox:AddBlank(Info.BlankSize or 6);
  2422.         Groupbox:Resize();
  2423.  
  2424.         Options[Idx] = Slider;
  2425.  
  2426.         return Slider;
  2427.     end;
  2428.  
  2429.     function Funcs:AddDropdown(Idx, Info)
  2430.         if Info.SpecialType == 'Player' then
  2431.             Info.Values = GetPlayersString();
  2432.             Info.AllowNull = true;
  2433.         elseif Info.SpecialType == 'Team' then
  2434.             Info.Values = GetTeamsString();
  2435.             Info.AllowNull = true;
  2436.         end;
  2437.  
  2438.         assert(Info.Values, 'AddDropdown: Missing dropdown value list.');
  2439.         assert(Info.AllowNull or Info.Default, 'AddDropdown: Missing default value. Pass `AllowNull` as true if this was intentional.')
  2440.  
  2441.         if (not Info.Text) then
  2442.             Info.Compact = true;
  2443.         end;
  2444.  
  2445.         local Dropdown = {
  2446.             Values = Info.Values;
  2447.             Value = Info.Multi and {};
  2448.             Multi = Info.Multi;
  2449.             Type = 'Dropdown';
  2450.             SpecialType = Info.SpecialType; -- can be either 'Player' or 'Team'
  2451.             Callback = Info.Callback or function(Value) end;
  2452.         };
  2453.  
  2454.         local Groupbox = self;
  2455.         local Container = Groupbox.Container;
  2456.  
  2457.         local RelativeOffset = 0;
  2458.  
  2459.         if not Info.Compact then
  2460.             local DropdownLabel = Library:CreateLabel({
  2461.                 Size = UDim2.new(1, 0, 0, 10);
  2462.                 TextSize = 14;
  2463.                 Text = Info.Text;
  2464.                 TextXAlignment = Enum.TextXAlignment.Left;
  2465.                 TextYAlignment = Enum.TextYAlignment.Bottom;
  2466.                 ZIndex = 5;
  2467.                 Parent = Container;
  2468.             });
  2469.  
  2470.             Groupbox:AddBlank(3);
  2471.         end
  2472.  
  2473.         for _, Element in next, Container:GetChildren() do
  2474.             if not Element:IsA('UIListLayout') then
  2475.                 RelativeOffset = RelativeOffset + Element.Size.Y.Offset;
  2476.             end;
  2477.         end;
  2478.  
  2479.         local DropdownOuter = Library:Create('Frame', {
  2480.             BackgroundColor3 = Color3.new(0, 0, 0);
  2481.             BorderColor3 = Color3.new(0, 0, 0);
  2482.             Size = UDim2.new(1, -4, 0, 20);
  2483.             ZIndex = 5;
  2484.             Parent = Container;
  2485.         });
  2486.  
  2487.         Library:AddToRegistry(DropdownOuter, {
  2488.             BorderColor3 = 'Black';
  2489.         });
  2490.  
  2491.         local DropdownInner = Library:Create('Frame', {
  2492.             BackgroundColor3 = Library.MainColor;
  2493.             BorderColor3 = Library.OutlineColor;
  2494.             BorderMode = Enum.BorderMode.Inset;
  2495.             Size = UDim2.new(1, 0, 1, 0);
  2496.             ZIndex = 6;
  2497.             Parent = DropdownOuter;
  2498.         });
  2499.  
  2500.         Library:AddToRegistry(DropdownInner, {
  2501.             BackgroundColor3 = 'MainColor';
  2502.             BorderColor3 = 'OutlineColor';
  2503.         });
  2504.  
  2505.         Library:Create('UIGradient', {
  2506.             Color = ColorSequence.new({
  2507.                 ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)),
  2508.                 ColorSequenceKeypoint.new(1, Color3.fromRGB(212, 212, 212))
  2509.             });
  2510.             Rotation = 90;
  2511.             Parent = DropdownInner;
  2512.         });
  2513.  
  2514.         local DropdownArrow = Library:Create('ImageLabel', {
  2515.             AnchorPoint = Vector2.new(0, 0.5);
  2516.             BackgroundTransparency = 1;
  2517.             Position = UDim2.new(1, -16, 0.5, 0);
  2518.             Size = UDim2.new(0, 12, 0, 12);
  2519.             Image = 'http://www.roblox.com/asset/?id=6282522798';
  2520.             ZIndex = 8;
  2521.             Parent = DropdownInner;
  2522.         });
  2523.  
  2524.         local ItemList = Library:CreateLabel({
  2525.             Position = UDim2.new(0, 5, 0, 0);
  2526.             Size = UDim2.new(1, -5, 1, 0);
  2527.             TextSize = 14;
  2528.             Text = '--';
  2529.             TextXAlignment = Enum.TextXAlignment.Left;
  2530.             TextWrapped = true;
  2531.             ZIndex = 7;
  2532.             Parent = DropdownInner;
  2533.         });
  2534.  
  2535.         Library:OnHighlight(DropdownOuter, DropdownOuter,
  2536.             { BorderColor3 = 'AccentColor' },
  2537.             { BorderColor3 = 'Black' }
  2538.         );
  2539.  
  2540.         if type(Info.Tooltip) == 'string' then
  2541.             Library:AddToolTip(Info.Tooltip, DropdownOuter)
  2542.         end
  2543.  
  2544.         local MAX_DROPDOWN_ITEMS = 10;
  2545.  
  2546.         local ListOuter = Library:Create('Frame', {
  2547.             BackgroundColor3 = Color3.new(0, 0, 0);
  2548.             BorderColor3 = Color3.new(0, 0, 0);
  2549.             ZIndex = 20;
  2550.             Visible = false;
  2551.             Parent = ScreenGui;
  2552.         });
  2553.  
  2554.         local function RecalculateListPosition()
  2555.             ListOuter.Position = UDim2.fromOffset(DropdownOuter.AbsolutePosition.X, DropdownOuter.AbsolutePosition.Y + DropdownOuter.Size.Y.Offset + 1);
  2556.         end;
  2557.  
  2558.         local function RecalculateListSize(YSize)
  2559.             local Y = YSize or math.clamp(#Dropdown.Values * 20, 0, MAX_DROPDOWN_ITEMS * 20) + 1;
  2560.             ListOuter.Size = UDim2.fromOffset(DropdownOuter.AbsoluteSize.X + 0.5, Y)
  2561.         end;
  2562.  
  2563.         RecalculateListPosition();
  2564.         RecalculateListSize();
  2565.  
  2566.         DropdownOuter:GetPropertyChangedSignal('AbsolutePosition'):Connect(RecalculateListPosition);
  2567.  
  2568.         local ListInner = Library:Create('Frame', {
  2569.             BackgroundColor3 = Library.MainColor;
  2570.             BorderColor3 = Library.OutlineColor;
  2571.             BorderMode = Enum.BorderMode.Inset;
  2572.             BorderSizePixel = 0;
  2573.             Size = UDim2.new(1, 0, 1, 0);
  2574.             ZIndex = 21;
  2575.             Parent = ListOuter;
  2576.         });
  2577.  
  2578.         Library:AddToRegistry(ListInner, {
  2579.             BackgroundColor3 = 'MainColor';
  2580.             BorderColor3 = 'OutlineColor';
  2581.         });
  2582.  
  2583.         local Scrolling = Library:Create('ScrollingFrame', {
  2584.             BackgroundTransparency = 1;
  2585.             BorderSizePixel = 0;
  2586.             CanvasSize = UDim2.new(0, 0, 0, 0);
  2587.             Size = UDim2.new(1, 0, 1, 0);
  2588.             ZIndex = 21;
  2589.             Parent = ListInner;
  2590.  
  2591.             TopImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png',
  2592.             BottomImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png',
  2593.  
  2594.             ScrollBarThickness = 12,
  2595.             ScrollBarImageColor3 = Library.AccentColor,
  2596.         });
  2597.  
  2598.         Library:AddToRegistry(Scrolling, {
  2599.             ScrollBarImageColor3 = 'AccentColor'
  2600.         })
  2601.  
  2602.         Library:Create('UIListLayout', {
  2603.             Padding = UDim.new(0, 0);
  2604.             FillDirection = Enum.FillDirection.Vertical;
  2605.             SortOrder = Enum.SortOrder.LayoutOrder;
  2606.             Parent = Scrolling;
  2607.         });
  2608.  
  2609.         function Dropdown:Display()
  2610.             local Values = Dropdown.Values;
  2611.             local Str = '';
  2612.  
  2613.             if Info.Multi then
  2614.                 for Idx, Value in next, Values do
  2615.                     if Dropdown.Value[Value] then
  2616.                         Str = Str .. Value .. ', ';
  2617.                     end;
  2618.                 end;
  2619.  
  2620.                 Str = Str:sub(1, #Str - 2);
  2621.             else
  2622.                 Str = Dropdown.Value or '';
  2623.             end;
  2624.  
  2625.             ItemList.Text = (Str == '' and '--' or Str);
  2626.         end;
  2627.  
  2628.         function Dropdown:GetActiveValues()
  2629.             if Info.Multi then
  2630.                 local T = {};
  2631.  
  2632.                 for Value, Bool in next, Dropdown.Value do
  2633.                     table.insert(T, Value);
  2634.                 end;
  2635.  
  2636.                 return T;
  2637.             else
  2638.                 return Dropdown.Value and 1 or 0;
  2639.             end;
  2640.         end;
  2641.  
  2642.         function Dropdown:BuildDropdownList()
  2643.             local Values = Dropdown.Values;
  2644.             local Buttons = {};
  2645.  
  2646.             for _, Element in next, Scrolling:GetChildren() do
  2647.                 if not Element:IsA('UIListLayout') then
  2648.                     Element:Destroy();
  2649.                 end;
  2650.             end;
  2651.  
  2652.             local Count = 0;
  2653.             for Idx, Value in next, Values do
  2654.                 local Table = {};
  2655.  
  2656.                 Count = Count + 1;
  2657.  
  2658.                 local Button = Library:Create('Frame', {
  2659.                     BackgroundColor3 = Library.MainColor;
  2660.                     BorderColor3 = Library.OutlineColor;
  2661.                     BorderMode = Enum.BorderMode.Middle;
  2662.                     Size = UDim2.new(1, -1, 0, 20);
  2663.                     ZIndex = 23;
  2664.                     Active = true,
  2665.                     Parent = Scrolling;
  2666.                 });
  2667.  
  2668.                 Library:AddToRegistry(Button, {
  2669.                     BackgroundColor3 = 'MainColor';
  2670.                     BorderColor3 = 'OutlineColor';
  2671.                 });
  2672.  
  2673.                 local ButtonLabel = Library:CreateLabel({
  2674.                     Active = false;
  2675.                     Size = UDim2.new(1, -6, 1, 0);
  2676.                     Position = UDim2.new(0, 6, 0, 0);
  2677.                     TextSize = 14;
  2678.                     Text = Value;
  2679.                     TextXAlignment = Enum.TextXAlignment.Left;
  2680.                     ZIndex = 25;
  2681.                     Parent = Button;
  2682.                 });
  2683.  
  2684.                 Library:OnHighlight(Button, Button,
  2685.                     { BorderColor3 = 'AccentColor', ZIndex = 24 },
  2686.                     { BorderColor3 = 'OutlineColor', ZIndex = 23 }
  2687.                 );
  2688.  
  2689.                 local Selected;
  2690.  
  2691.                 if Info.Multi then
  2692.                     Selected = Dropdown.Value[Value];
  2693.                 else
  2694.                     Selected = Dropdown.Value == Value;
  2695.                 end;
  2696.  
  2697.                 function Table:UpdateButton()
  2698.                     if Info.Multi then
  2699.                         Selected = Dropdown.Value[Value];
  2700.                     else
  2701.                         Selected = Dropdown.Value == Value;
  2702.                     end;
  2703.  
  2704.                     ButtonLabel.TextColor3 = Selected and Library.AccentColor or Library.FontColor;
  2705.                     Library.RegistryMap[ButtonLabel].Properties.TextColor3 = Selected and 'AccentColor' or 'FontColor';
  2706.                 end;
  2707.  
  2708.                 ButtonLabel.InputBegan:Connect(function(Input)
  2709.                     if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2710.                         local Try = not Selected;
  2711.  
  2712.                         if Dropdown:GetActiveValues() == 1 and (not Try) and (not Info.AllowNull) then
  2713.                         else
  2714.                             if Info.Multi then
  2715.                                 Selected = Try;
  2716.  
  2717.                                 if Selected then
  2718.                                     Dropdown.Value[Value] = true;
  2719.                                 else
  2720.                                     Dropdown.Value[Value] = nil;
  2721.                                 end;
  2722.                             else
  2723.                                 Selected = Try;
  2724.  
  2725.                                 if Selected then
  2726.                                     Dropdown.Value = Value;
  2727.                                 else
  2728.                                     Dropdown.Value = nil;
  2729.                                 end;
  2730.  
  2731.                                 for _, OtherButton in next, Buttons do
  2732.                                     OtherButton:UpdateButton();
  2733.                                 end;
  2734.                             end;
  2735.  
  2736.                             Table:UpdateButton();
  2737.                             Dropdown:Display();
  2738.                            
  2739.                             Library:UpdateDependencyBoxes();
  2740.                             Library:SafeCallback(Dropdown.Callback, Dropdown.Value);
  2741.                             Library:SafeCallback(Dropdown.Changed, Dropdown.Value);
  2742.  
  2743.                             Library:AttemptSave();
  2744.                         end;
  2745.                     end;
  2746.                 end);
  2747.  
  2748.                 Table:UpdateButton();
  2749.                 Dropdown:Display();
  2750.  
  2751.                 Buttons[Button] = Table;
  2752.             end;
  2753.  
  2754.             Scrolling.CanvasSize = UDim2.fromOffset(0, (Count * 20) + 1);
  2755.  
  2756.             -- Workaround for silly roblox bug - not sure why it happens but sometimes the dropdown list will be empty
  2757.             -- ... and for some reason refreshing the Visible property fixes the issue??????? thanks roblox!
  2758.             Scrolling.Visible = false;
  2759.             Scrolling.Visible = true;
  2760.  
  2761.             local Y = math.clamp(Count * 20, 0, MAX_DROPDOWN_ITEMS * 20) + 1;
  2762.             RecalculateListSize(Y);
  2763.         end;
  2764.  
  2765.         function Dropdown:SetValues(NewValues)
  2766.             if NewValues then
  2767.                 Dropdown.Values = NewValues;
  2768.             end;
  2769.  
  2770.             Dropdown:BuildDropdownList();
  2771.         end;
  2772.  
  2773.         function Dropdown:OpenDropdown()
  2774.             if Library.IsMobile then
  2775.                 Library.CanDrag = false;
  2776.             end;
  2777.  
  2778.             ListOuter.Visible = true;
  2779.             Library.OpenedFrames[ListOuter] = true;
  2780.             DropdownArrow.Rotation = 180;
  2781.            
  2782.             RecalculateListSize();
  2783.         end;
  2784.  
  2785.         function Dropdown:CloseDropdown()
  2786.             if Library.IsMobile then            
  2787.                 Library.CanDrag = true;
  2788.             end;
  2789.  
  2790.             ListOuter.Visible = false;
  2791.             Library.OpenedFrames[ListOuter] = nil;
  2792.             DropdownArrow.Rotation = 0;
  2793.         end;
  2794.  
  2795.         function Dropdown:OnChanged(Func)
  2796.             Dropdown.Changed = Func;
  2797.             Func(Dropdown.Value);
  2798.         end;
  2799.  
  2800.         function Dropdown:SetValue(Val)
  2801.             if Dropdown.Multi then
  2802.                 local nTable = {};
  2803.  
  2804.                 for Value, Bool in next, Val do
  2805.                     if table.find(Dropdown.Values, Value) then
  2806.                         nTable[Value] = true
  2807.                     end;
  2808.                 end;
  2809.  
  2810.                 Dropdown.Value = nTable;
  2811.             else
  2812.                 if (not Val) then
  2813.                     Dropdown.Value = nil;
  2814.                 elseif table.find(Dropdown.Values, Val) then
  2815.                     Dropdown.Value = Val;
  2816.                 end;
  2817.             end;
  2818.  
  2819.             Dropdown:BuildDropdownList();
  2820.  
  2821.             Library:SafeCallback(Dropdown.Callback, Dropdown.Value);
  2822.             Library:SafeCallback(Dropdown.Changed, Dropdown.Value);
  2823.         end;
  2824.  
  2825.         DropdownOuter.InputBegan:Connect(function(Input)
  2826.             if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame()) or Input.UserInputType == Enum.UserInputType.Touch then
  2827.                 if ListOuter.Visible then
  2828.                     Dropdown:CloseDropdown();
  2829.                 else
  2830.                     Dropdown:OpenDropdown();
  2831.                 end;
  2832.             end;
  2833.         end);
  2834.  
  2835.         InputService.InputBegan:Connect(function(Input)
  2836.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2837.                 local AbsPos, AbsSize = ListOuter.AbsolutePosition, ListOuter.AbsoluteSize;
  2838.  
  2839.                 if Mouse.X < AbsPos.X or Mouse.X > AbsPos.X + AbsSize.X
  2840.                     or Mouse.Y < (AbsPos.Y - 20 - 1) or Mouse.Y > AbsPos.Y + AbsSize.Y then
  2841.  
  2842.                     Dropdown:CloseDropdown();
  2843.                 end;
  2844.             end;
  2845.         end);
  2846.  
  2847.         Dropdown:BuildDropdownList();
  2848.         Dropdown:Display();
  2849.  
  2850.         local Defaults = {}
  2851.  
  2852.         if type(Info.Default) == 'string' then
  2853.             local Idx = table.find(Dropdown.Values, Info.Default)
  2854.             if Idx then
  2855.                 table.insert(Defaults, Idx)
  2856.             end
  2857.         elseif type(Info.Default) == 'table' then
  2858.             for _, Value in next, Info.Default do
  2859.                 local Idx = table.find(Dropdown.Values, Value)
  2860.                 if Idx then
  2861.                     table.insert(Defaults, Idx)
  2862.                 end
  2863.             end
  2864.         elseif type(Info.Default) == 'number' and Dropdown.Values[Info.Default] ~= nil then
  2865.             table.insert(Defaults, Info.Default)
  2866.         end
  2867.  
  2868.         if next(Defaults) then
  2869.             for i = 1, #Defaults do
  2870.                 local Index = Defaults[i]
  2871.                 if Info.Multi then
  2872.                     Dropdown.Value[Dropdown.Values[Index]] = true
  2873.                 else
  2874.                     Dropdown.Value = Dropdown.Values[Index];
  2875.                 end
  2876.  
  2877.                 if (not Info.Multi) then break end
  2878.             end
  2879.  
  2880.             Dropdown:BuildDropdownList();
  2881.             Dropdown:Display();
  2882.         end
  2883.  
  2884.         Groupbox:AddBlank(Info.BlankSize or 5);
  2885.         Groupbox:Resize();
  2886.  
  2887.         Options[Idx] = Dropdown;
  2888.  
  2889.         return Dropdown;
  2890.     end;
  2891.  
  2892.     function Funcs:AddDependencyBox()
  2893.         local Depbox = {
  2894.             Dependencies = {};
  2895.         };
  2896.        
  2897.         local Groupbox = self;
  2898.         local Container = Groupbox.Container;
  2899.  
  2900.         local Holder = Library:Create('Frame', {
  2901.             BackgroundTransparency = 1;
  2902.             Size = UDim2.new(1, 0, 0, 0);
  2903.             Visible = false;
  2904.             Parent = Container;
  2905.         });
  2906.  
  2907.         local Frame = Library:Create('Frame', {
  2908.             BackgroundTransparency = 1;
  2909.             Size = UDim2.new(1, 0, 1, 0);
  2910.             Visible = true;
  2911.             Parent = Holder;
  2912.         });
  2913.  
  2914.         local Layout = Library:Create('UIListLayout', {
  2915.             FillDirection = Enum.FillDirection.Vertical;
  2916.             SortOrder = Enum.SortOrder.LayoutOrder;
  2917.             Parent = Frame;
  2918.         });
  2919.  
  2920.         function Depbox:Resize()
  2921.             Holder.Size = UDim2.new(1, 0, 0, Layout.AbsoluteContentSize.Y);
  2922.             Groupbox:Resize();
  2923.         end;
  2924.  
  2925.         Layout:GetPropertyChangedSignal('AbsoluteContentSize'):Connect(function()
  2926.             Depbox:Resize();
  2927.         end);
  2928.  
  2929.         Holder:GetPropertyChangedSignal('Visible'):Connect(function()
  2930.             Depbox:Resize();
  2931.         end);
  2932.  
  2933.         function Depbox:Update()
  2934.             for _, Dependency in next, Depbox.Dependencies do
  2935.                 local Elem = Dependency[1];
  2936.                 local Value = Dependency[2];
  2937.  
  2938.                 if if Elem.Multi then not table.find(Elem:GetActiveValues(), Value) else Elem.Value ~= Value then
  2939.                     Holder.Visible = false;
  2940.                     Depbox:Resize();
  2941.                     return;
  2942.                 end;
  2943.             end;
  2944.  
  2945.             Holder.Visible = true;
  2946.             Depbox:Resize();
  2947.         end;
  2948.  
  2949.         function Depbox:SetupDependencies(Dependencies)
  2950.             for _, Dependency in next, Dependencies do
  2951.                 assert(type(Dependency) == 'table', 'SetupDependencies: Dependency is not of type `table`.');
  2952.                 assert(Dependency[1], 'SetupDependencies: Dependency is missing element argument.');
  2953.                 assert(Dependency[2] ~= nil, 'SetupDependencies: Dependency is missing value argument.');
  2954.             end;
  2955.  
  2956.             Depbox.Dependencies = Dependencies;
  2957.             Depbox:Update();
  2958.         end;
  2959.  
  2960.         Depbox.Container = Frame;
  2961.  
  2962.         setmetatable(Depbox, BaseGroupbox);
  2963.  
  2964.         table.insert(Library.DependencyBoxes, Depbox);
  2965.  
  2966.         return Depbox;
  2967.     end;
  2968.  
  2969.     BaseGroupbox.__index = Funcs;
  2970.     BaseGroupbox.__namecall = function(Table, Key, ...)
  2971.         return Funcs[Key](...);
  2972.     end;
  2973. end;
  2974.  
  2975. -- < Create other UI elements >
  2976. do
  2977.     Library.NotificationArea = Library:Create('Frame', {
  2978.         BackgroundTransparency = 1;
  2979.         Position = UDim2.new(0, 0, 0, 40);
  2980.         Size = UDim2.new(0, 300, 0, 200);
  2981.         ZIndex = 100;
  2982.         Parent = ScreenGui;
  2983.     });
  2984.  
  2985.     Library:Create('UIListLayout', {
  2986.         Padding = UDim.new(0, 4);
  2987.         FillDirection = Enum.FillDirection.Vertical;
  2988.         SortOrder = Enum.SortOrder.LayoutOrder;
  2989.         Parent = Library.NotificationArea;
  2990.     });
  2991.  
  2992.     local WatermarkOuter = Library:Create('Frame', {
  2993.         BorderColor3 = Color3.new(0, 0, 0);
  2994.         Position = UDim2.new(0, 100, 0, -25);
  2995.         Size = UDim2.new(0, 213, 0, 20);
  2996.         ZIndex = 200;
  2997.         Visible = false;
  2998.         Parent = ScreenGui;
  2999.     });
  3000.  
  3001.     local WatermarkInner = Library:Create('Frame', {
  3002.         BackgroundColor3 = Library.MainColor;
  3003.         BorderColor3 = Library.AccentColor;
  3004.         BorderMode = Enum.BorderMode.Inset;
  3005.         Size = UDim2.new(1, 0, 1, 0);
  3006.         ZIndex = 201;
  3007.         Parent = WatermarkOuter;
  3008.     });
  3009.  
  3010.     Library:AddToRegistry(WatermarkInner, {
  3011.         BorderColor3 = 'AccentColor';
  3012.     });
  3013.  
  3014.     local InnerFrame = Library:Create('Frame', {
  3015.         BackgroundColor3 = Color3.new(1, 1, 1);
  3016.         BorderSizePixel = 0;
  3017.         Position = UDim2.new(0, 1, 0, 1);
  3018.         Size = UDim2.new(1, -2, 1, -2);
  3019.         ZIndex = 202;
  3020.         Parent = WatermarkInner;
  3021.     });
  3022.  
  3023.     local Gradient = Library:Create('UIGradient', {
  3024.         Color = ColorSequence.new({
  3025.             ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  3026.             ColorSequenceKeypoint.new(1, Library.MainColor),
  3027.         });
  3028.         Rotation = -90;
  3029.         Parent = InnerFrame;
  3030.     });
  3031.  
  3032.     Library:AddToRegistry(Gradient, {
  3033.         Color = function()
  3034.             return ColorSequence.new({
  3035.                 ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  3036.                 ColorSequenceKeypoint.new(1, Library.MainColor),
  3037.             });
  3038.         end
  3039.     });
  3040.  
  3041.     local WatermarkLabel = Library:CreateLabel({
  3042.         Position = UDim2.new(0, 5, 0, 0);
  3043.         Size = UDim2.new(1, -4, 1, 0);
  3044.         TextSize = 14;
  3045.         TextXAlignment = Enum.TextXAlignment.Left;
  3046.         ZIndex = 203;
  3047.         Parent = InnerFrame;
  3048.     });
  3049.  
  3050.     Library.Watermark = WatermarkOuter;
  3051.     Library.WatermarkText = WatermarkLabel;
  3052.     Library:MakeDraggable(Library.Watermark);
  3053.  
  3054.     local KeybindOuter = Library:Create('Frame', {
  3055.         AnchorPoint = Vector2.new(0, 0.5);
  3056.         BorderColor3 = Color3.new(0, 0, 0);
  3057.         Position = UDim2.new(0, 10, 0.5, 0);
  3058.         Size = UDim2.new(0, 210, 0, 20);
  3059.         Visible = false;
  3060.         ZIndex = 100;
  3061.         Parent = ScreenGui;
  3062.     });
  3063.  
  3064.     local KeybindInner = Library:Create('Frame', {
  3065.         BackgroundColor3 = Library.MainColor;
  3066.         BorderColor3 = Library.OutlineColor;
  3067.         BorderMode = Enum.BorderMode.Inset;
  3068.         Size = UDim2.new(1, 0, 1, 0);
  3069.         ZIndex = 101;
  3070.         Parent = KeybindOuter;
  3071.     });
  3072.  
  3073.     Library:AddToRegistry(KeybindInner, {
  3074.         BackgroundColor3 = 'MainColor';
  3075.         BorderColor3 = 'OutlineColor';
  3076.     }, true);
  3077.  
  3078.     local ColorFrame = Library:Create('Frame', {
  3079.         BackgroundColor3 = Library.AccentColor;
  3080.         BorderSizePixel = 0;
  3081.         Size = UDim2.new(1, 0, 0, 2);
  3082.         ZIndex = 102;
  3083.         Parent = KeybindInner;
  3084.     });
  3085.  
  3086.     Library:AddToRegistry(ColorFrame, {
  3087.         BackgroundColor3 = 'AccentColor';
  3088.     }, true);
  3089.  
  3090.     local KeybindLabel = Library:CreateLabel({
  3091.         Size = UDim2.new(1, 0, 0, 20);
  3092.         Position = UDim2.fromOffset(5, 2),
  3093.         TextXAlignment = Enum.TextXAlignment.Left,
  3094.  
  3095.         Text = 'Keybinds';
  3096.         ZIndex = 104;
  3097.         Parent = KeybindInner;
  3098.     });
  3099.     Library:MakeDraggable(KeybindOuter);
  3100.  
  3101.     local KeybindContainer = Library:Create('Frame', {
  3102.         BackgroundTransparency = 1;
  3103.         Size = UDim2.new(1, 0, 1, -20);
  3104.         Position = UDim2.new(0, 0, 0, 20);
  3105.         ZIndex = 1;
  3106.         Parent = KeybindInner;
  3107.     });
  3108.  
  3109.     Library:Create('UIListLayout', {
  3110.         FillDirection = Enum.FillDirection.Vertical;
  3111.         SortOrder = Enum.SortOrder.LayoutOrder;
  3112.         Parent = KeybindContainer;
  3113.     });
  3114.  
  3115.     Library:Create('UIPadding', {
  3116.         PaddingLeft = UDim.new(0, 5),
  3117.         Parent = KeybindContainer,
  3118.     })
  3119.  
  3120.     Library.KeybindFrame = KeybindOuter;
  3121.     Library.KeybindContainer = KeybindContainer;
  3122.     Library:MakeDraggable(KeybindOuter);
  3123. end;
  3124.  
  3125. function Library:SetWatermarkVisibility(Bool)
  3126.     Library.Watermark.Visible = Bool;
  3127. end;
  3128.  
  3129. function Library:SetWatermark(Text)
  3130.     local X, Y = Library:GetTextBounds(Text, Library.Font, 14);
  3131.     Library.Watermark.Size = UDim2.new(0, X + 15, 0, (Y * 1.5) + 3);
  3132.     Library:SetWatermarkVisibility(true)
  3133.  
  3134.     Library.WatermarkText.Text = Text;
  3135. end;
  3136.  
  3137. function Library:Notify(Text, Time, SoundId)
  3138.     local XSize, YSize = Library:GetTextBounds(Text, Library.Font, 14);
  3139.  
  3140.     YSize = YSize + 7
  3141.  
  3142.     local NotifyOuter = Library:Create('Frame', {
  3143.         BorderColor3 = Color3.new(0, 0, 0);
  3144.         Position = UDim2.new(0, 100, 0, 10);
  3145.         Size = UDim2.new(0, 0, 0, YSize);
  3146.         ClipsDescendants = true;
  3147.         ZIndex = 100;
  3148.         Parent = Library.NotificationArea;
  3149.     });
  3150.  
  3151.     local NotifyInner = Library:Create('Frame', {
  3152.         BackgroundColor3 = Library.MainColor;
  3153.         BorderColor3 = Library.OutlineColor;
  3154.         BorderMode = Enum.BorderMode.Inset;
  3155.         Size = UDim2.new(1, 0, 1, 0);
  3156.         ZIndex = 101;
  3157.         Parent = NotifyOuter;
  3158.     });
  3159.  
  3160.     Library:AddToRegistry(NotifyInner, {
  3161.         BackgroundColor3 = 'MainColor';
  3162.         BorderColor3 = 'OutlineColor';
  3163.     }, true);
  3164.  
  3165.     local InnerFrame = Library:Create('Frame', {
  3166.         BackgroundColor3 = Color3.new(1, 1, 1);
  3167.         BorderSizePixel = 0;
  3168.         Position = UDim2.new(0, 1, 0, 1);
  3169.         Size = UDim2.new(1, -2, 1, -2);
  3170.         ZIndex = 102;
  3171.         Parent = NotifyInner;
  3172.     });
  3173.  
  3174.     local Gradient = Library:Create('UIGradient', {
  3175.         Color = ColorSequence.new({
  3176.             ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  3177.             ColorSequenceKeypoint.new(1, Library.MainColor),
  3178.         });
  3179.         Rotation = -90;
  3180.         Parent = InnerFrame;
  3181.     });
  3182.  
  3183.     Library:AddToRegistry(Gradient, {
  3184.         Color = function()
  3185.             return ColorSequence.new({
  3186.                 ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  3187.                 ColorSequenceKeypoint.new(1, Library.MainColor),
  3188.             });
  3189.         end
  3190.     });
  3191.  
  3192.     local NotifyLabel = Library:CreateLabel({
  3193.         Position = UDim2.new(0, 4, 0, 0);
  3194.         Size = UDim2.new(1, -4, 1, 0);
  3195.         Text = Text;
  3196.         TextXAlignment = Enum.TextXAlignment.Left;
  3197.         TextSize = 14;
  3198.         ZIndex = 103;
  3199.         Parent = InnerFrame;
  3200.     });
  3201.  
  3202.     local LeftColor = Library:Create('Frame', {
  3203.         BackgroundColor3 = Library.AccentColor;
  3204.         BorderSizePixel = 0;
  3205.         Position = UDim2.new(0, -1, 0, -1);
  3206.         Size = UDim2.new(0, 3, 1, 2);
  3207.         ZIndex = 104;
  3208.         Parent = NotifyOuter;
  3209.     });
  3210.  
  3211.     Library:AddToRegistry(LeftColor, {
  3212.         BackgroundColor3 = 'AccentColor';
  3213.     }, true);
  3214.  
  3215.     if SoundId then
  3216.         Library:Create('Sound', {
  3217.             SoundId = "rbxassetid://" .. tostring(SoundId):gsub("rbxassetid://", "");
  3218.             Volume = 3;
  3219.             PlayOnRemove = true;
  3220.             Parent = game:GetService("SoundService");
  3221.         }):Destroy();
  3222.     end
  3223.  
  3224.     pcall(NotifyOuter.TweenSize, NotifyOuter, UDim2.new(0, XSize + 8 + 4, 0, YSize), 'Out', 'Quad', 0.4, true);
  3225.  
  3226.     task.spawn(function()
  3227.         if typeof(Time) == "Instance" then
  3228.             Time.Destroying:Wait();
  3229.         else
  3230.             task.wait(Time or 5);
  3231.         end
  3232.  
  3233.         pcall(NotifyOuter.TweenSize, NotifyOuter, UDim2.new(0, 0, 0, YSize), 'Out', 'Quad', 0.4, true);
  3234.  
  3235.         task.wait(0.4);
  3236.  
  3237.         NotifyOuter:Destroy();
  3238.     end);
  3239. end;
  3240.  
  3241. function Library:CreateWindow(...)
  3242.     local Arguments = { ... }
  3243.     local Config = { AnchorPoint = Vector2.zero }
  3244.  
  3245.     if type(...) == 'table' then
  3246.         Config = ...;
  3247.     else
  3248.         Config.Title = Arguments[1]
  3249.         Config.AutoShow = Arguments[2] or false;
  3250.     end
  3251.  
  3252.     if type(Config.Title) ~= 'string' then Config.Title = 'No title' end
  3253.     if type(Config.TabPadding) ~= 'number' then Config.TabPadding = 1 end
  3254.     if type(Config.MenuFadeTime) ~= 'number' then Config.MenuFadeTime = 0.2 end
  3255.     if type(Config.ShowCustomCursor) ~= 'boolean' then Library.ShowCustomCursor = false else Library.ShowCustomCursor = Config.ShowCustomCursor end
  3256.  
  3257.     if typeof(Config.Position) ~= 'UDim2' then Config.Position = UDim2.fromOffset(175, 50) end
  3258.     if typeof(Config.Size) ~= 'UDim2' then
  3259.         Config.Size = UDim2.fromOffset(550, 600)
  3260.         if Library.IsMobile then
  3261.             Config.Size = UDim2.fromOffset(550, 400)
  3262.         end
  3263.     end
  3264.  
  3265.     if Config.TabPadding <= 0 then
  3266.         Config.TabPadding = 1
  3267.     end
  3268.  
  3269.     if Config.Center then
  3270.         -- Config.AnchorPoint = Vector2.new(0.5, 0.5)
  3271.         Config.Position = UDim2.new(0.5, -Config.Size.X.Offset/2, 0.5, -Config.Size.Y.Offset/2)
  3272.     end
  3273.    
  3274.     local Window = {
  3275.         Tabs = {};
  3276.     };
  3277.  
  3278.     local Outer = Library:Create('Frame', {
  3279.         AnchorPoint = Config.AnchorPoint;
  3280.         BackgroundColor3 = Color3.new(0, 0, 0);
  3281.         BorderSizePixel = 0;
  3282.         Position = Config.Position;
  3283.         Size = Config.Size;
  3284.         Visible = false;
  3285.         ZIndex = 1;
  3286.         Parent = ScreenGui;
  3287.     });
  3288.     LibraryMainOuterFrame = Outer;
  3289.     Library:MakeDraggable(Outer, 25);
  3290.  
  3291.     if Config.Resizable then
  3292.         Library:MakeResizable(Outer, Library.MinSize);
  3293.     end
  3294.  
  3295.     local Inner = Library:Create('Frame', {
  3296.         BackgroundColor3 = Library.MainColor;
  3297.         BorderColor3 = Library.AccentColor;
  3298.         BorderMode = Enum.BorderMode.Inset;
  3299.         Position = UDim2.new(0, 1, 0, 1);
  3300.         Size = UDim2.new(1, -2, 1, -2);
  3301.         ZIndex = 1;
  3302.         Parent = Outer;
  3303.     });
  3304.  
  3305.     Library:AddToRegistry(Inner, {
  3306.         BackgroundColor3 = 'MainColor';
  3307.         BorderColor3 = 'AccentColor';
  3308.     });
  3309.  
  3310.     local WindowLabel = Library:CreateLabel({
  3311.         Position = UDim2.new(0, 7, 0, 0);
  3312.         Size = UDim2.new(0, 0, 0, 25);
  3313.         Text = Config.Title or '';
  3314.         TextXAlignment = Enum.TextXAlignment.Left;
  3315.         ZIndex = 1;
  3316.         Parent = Inner;
  3317.     });
  3318.  
  3319.     local MainSectionOuter = Library:Create('Frame', {
  3320.         BackgroundColor3 = Library.BackgroundColor;
  3321.         BorderColor3 = Library.OutlineColor;
  3322.         Position = UDim2.new(0, 8, 0, 25);
  3323.         Size = UDim2.new(1, -16, 1, -33);
  3324.         ZIndex = 1;
  3325.         Parent = Inner;
  3326.     });
  3327.  
  3328.     Library:AddToRegistry(MainSectionOuter, {
  3329.         BackgroundColor3 = 'BackgroundColor';
  3330.         BorderColor3 = 'OutlineColor';
  3331.     });
  3332.  
  3333.     local MainSectionInner = Library:Create('Frame', {
  3334.         BackgroundColor3 = Library.BackgroundColor;
  3335.         BorderColor3 = Color3.new(0, 0, 0);
  3336.         BorderMode = Enum.BorderMode.Inset;
  3337.         Position = UDim2.new(0, 0, 0, 0);
  3338.         Size = UDim2.new(1, 0, 1, 0);
  3339.         ZIndex = 1;
  3340.         Parent = MainSectionOuter;
  3341.     });
  3342.  
  3343.     Library:AddToRegistry(MainSectionInner, {
  3344.         BackgroundColor3 = 'BackgroundColor';
  3345.     });
  3346.  
  3347.     local TabArea = Library:Create('ScrollingFrame', {
  3348.         ScrollingDirection = Enum.ScrollingDirection.X;
  3349.         CanvasSize = UDim2.new(0, 0, 2, 0);
  3350.         HorizontalScrollBarInset = Enum.ScrollBarInset.Always;
  3351.         AutomaticCanvasSize = Enum.AutomaticSize.XY;
  3352.         ScrollBarThickness = 0;
  3353.         BackgroundTransparency = 1;
  3354.         Position = UDim2.new(0, 8 - Config.TabPadding, 0, 4);
  3355.         Size = UDim2.new(1, -10, 0, 26);
  3356.         ZIndex = 1;
  3357.         Parent = MainSectionInner;
  3358.     });
  3359.  
  3360.     local TabListLayout = Library:Create('UIListLayout', {
  3361.         Padding = UDim.new(0, Config.TabPadding);
  3362.         FillDirection = Enum.FillDirection.Horizontal;
  3363.         SortOrder = Enum.SortOrder.LayoutOrder;
  3364.         VerticalAlignment = Enum.VerticalAlignment.Center;
  3365.         Parent = TabArea;
  3366.     });
  3367.  
  3368.     Library:Create('Frame', {
  3369.         BackgroundColor3 = Library.BackgroundColor;
  3370.         BorderColor3 = Library.OutlineColor;
  3371.         Size = UDim2.new(0, 0, 0, 0);
  3372.         LayoutOrder = -1;
  3373.         BackgroundTransparency = 1;
  3374.         ZIndex = 1;
  3375.         Parent = TabArea;
  3376.     });
  3377.     Library:Create('Frame', {
  3378.         BackgroundColor3 = Library.BackgroundColor;
  3379.         BorderColor3 = Library.OutlineColor;
  3380.         Size = UDim2.new(0, 0, 0, 0);
  3381.         LayoutOrder = 9999999;
  3382.         BackgroundTransparency = 1;
  3383.         ZIndex = 1;
  3384.         Parent = TabArea;
  3385.     });
  3386.  
  3387.     local TabContainer = Library:Create('Frame', {
  3388.         BackgroundColor3 = Library.MainColor;
  3389.         BorderColor3 = Library.OutlineColor;
  3390.         Position = UDim2.new(0, 8, 0, 30);
  3391.         Size = UDim2.new(1, -16, 1, -38);
  3392.         ZIndex = 2;
  3393.         Parent = MainSectionInner;
  3394.     });
  3395.    
  3396.     local InnerVideoBackground = Library:Create('VideoFrame', {
  3397.         BackgroundColor3 = Library.MainColor;
  3398.         BorderMode = Enum.BorderMode.Inset;
  3399.         BorderSizePixel = 0;
  3400.         Position = UDim2.new(0, 1, 0, 1);
  3401.         Size = UDim2.new(1, -2, 1, -2);
  3402.         ZIndex = 2;
  3403.         Visible = false;
  3404.         Volume = 0;
  3405.         Looped = true;
  3406.         Parent = TabContainer;
  3407.     });
  3408.     Library.InnerVideoBackground = InnerVideoBackground;
  3409.  
  3410.     Library:AddToRegistry(TabContainer, {
  3411.         BackgroundColor3 = 'MainColor';
  3412.         BorderColor3 = 'OutlineColor';
  3413.     });
  3414.  
  3415.     function Window:SetWindowTitle(Title)
  3416.         WindowLabel.Text = Title;
  3417.     end;
  3418.  
  3419.     function Window:AddTab(Name)
  3420.         local Tab = {
  3421.             Groupboxes = {};
  3422.             Tabboxes = {};
  3423.         };
  3424.  
  3425.         local TabButtonWidth = Library:GetTextBounds(Name, Library.Font, 16);
  3426.  
  3427.         local TabButton = Library:Create('Frame', {
  3428.             BackgroundColor3 = Library.BackgroundColor;
  3429.             BorderColor3 = Library.OutlineColor;
  3430.             Size = UDim2.new(0, TabButtonWidth + 8 + 4, 0.85, 0);
  3431.             ZIndex = 1;
  3432.             Parent = TabArea;
  3433.         });
  3434.  
  3435.         Library:AddToRegistry(TabButton, {
  3436.             BackgroundColor3 = 'BackgroundColor';
  3437.             BorderColor3 = 'OutlineColor';
  3438.         });
  3439.  
  3440.         local TabButtonLabel = Library:CreateLabel({
  3441.             Position = UDim2.new(0, 0, 0, 0);
  3442.             Size = UDim2.new(1, 0, 1, -1);
  3443.             Text = Name;
  3444.             ZIndex = 1;
  3445.             Parent = TabButton;
  3446.         });
  3447.  
  3448.         local Blocker = Library:Create('Frame', {
  3449.             BackgroundColor3 = Library.MainColor;
  3450.             BorderSizePixel = 0;
  3451.             Position = UDim2.new(0, 0, 1, 0);
  3452.             Size = UDim2.new(1, 0, 0, 1);
  3453.             BackgroundTransparency = 1;
  3454.             ZIndex = 3;
  3455.             Parent = TabButton;
  3456.         });
  3457.  
  3458.         Library:AddToRegistry(Blocker, {
  3459.             BackgroundColor3 = 'MainColor';
  3460.         });
  3461.  
  3462.         local TabFrame = Library:Create('Frame', {
  3463.             Name = 'TabFrame',
  3464.             BackgroundTransparency = 1;
  3465.             Position = UDim2.new(0, 0, 0, 0);
  3466.             Size = UDim2.new(1, 0, 1, 0);
  3467.             Visible = false;
  3468.             ZIndex = 2;
  3469.             Parent = TabContainer;
  3470.         });
  3471.  
  3472.         local LeftSide = Library:Create('ScrollingFrame', {
  3473.             BackgroundTransparency = 1;
  3474.             BorderSizePixel = 0;
  3475.             Position = UDim2.new(0, 8 - 1, 0, 8 - 1);
  3476.             Size = UDim2.new(0.5, -12 + 2, 1, -14);
  3477.             CanvasSize = UDim2.new(0, 0, 0, 0);
  3478.             BottomImage = '';
  3479.             TopImage = '';
  3480.             ScrollBarThickness = 0;
  3481.             ZIndex = 2;
  3482.             Parent = TabFrame;
  3483.         });
  3484.  
  3485.         local RightSide = Library:Create('ScrollingFrame', {
  3486.             BackgroundTransparency = 1;
  3487.             BorderSizePixel = 0;
  3488.             Position = UDim2.new(0.5, 4 + 1, 0, 8 - 1);
  3489.             Size = UDim2.new(0.5, -12 + 2, 1, -14);
  3490.             CanvasSize = UDim2.new(0, 0, 0, 0);
  3491.             BottomImage = '';
  3492.             TopImage = '';
  3493.             ScrollBarThickness = 0;
  3494.             ZIndex = 2;
  3495.             Parent = TabFrame;
  3496.         });
  3497.  
  3498.         Library:Create('UIListLayout', {
  3499.             Padding = UDim.new(0, 8);
  3500.             FillDirection = Enum.FillDirection.Vertical;
  3501.             SortOrder = Enum.SortOrder.LayoutOrder;
  3502.             HorizontalAlignment = Enum.HorizontalAlignment.Center;
  3503.             Parent = LeftSide;
  3504.         });
  3505.  
  3506.         Library:Create('UIListLayout', {
  3507.             Padding = UDim.new(0, 8);
  3508.             FillDirection = Enum.FillDirection.Vertical;
  3509.             SortOrder = Enum.SortOrder.LayoutOrder;
  3510.             HorizontalAlignment = Enum.HorizontalAlignment.Center;
  3511.             Parent = RightSide;
  3512.         });
  3513.  
  3514.         if Library.IsMobile then
  3515.             local SidesValues = {
  3516.                 ["Left"] = tick(),
  3517.                 ["Right"] = tick(),
  3518.             }
  3519.  
  3520.             LeftSide:GetPropertyChangedSignal('CanvasPosition'):Connect(function()
  3521.                 Library.CanDrag = false;
  3522.  
  3523.                 local ChangeTick = tick();
  3524.                 SidesValues.Left = ChangeTick;
  3525.                 task.wait(0.15);
  3526.  
  3527.                 if SidesValues.Left == ChangeTick then
  3528.                     Library.CanDrag = true;
  3529.                 end
  3530.             end);
  3531.  
  3532.             RightSide:GetPropertyChangedSignal('CanvasPosition'):Connect(function()
  3533.                 Library.CanDrag = false;
  3534.  
  3535.                 local ChangeTick = tick();
  3536.                 SidesValues.Right = ChangeTick;
  3537.                 task.wait(0.15);
  3538.                
  3539.                 if SidesValues.Right == ChangeTick then
  3540.                     Library.CanDrag = true;
  3541.                 end
  3542.             end);
  3543.         end;
  3544.  
  3545.         for _, Side in next, { LeftSide, RightSide } do
  3546.             Side:WaitForChild('UIListLayout'):GetPropertyChangedSignal('AbsoluteContentSize'):Connect(function()
  3547.                 Side.CanvasSize = UDim2.fromOffset(0, Side.UIListLayout.AbsoluteContentSize.Y);
  3548.             end);
  3549.         end;
  3550.  
  3551.         function Tab:ShowTab()
  3552.             Library.ActiveTab = Name;
  3553.             for _, Tab in next, Window.Tabs do
  3554.                 Tab:HideTab();
  3555.             end;
  3556.  
  3557.             Blocker.BackgroundTransparency = 0;
  3558.             TabButton.BackgroundColor3 = Library.MainColor;
  3559.             Library.RegistryMap[TabButton].Properties.BackgroundColor3 = 'MainColor';
  3560.             TabFrame.Visible = true;
  3561.         end;
  3562.  
  3563.         function Tab:HideTab()
  3564.             Blocker.BackgroundTransparency = 1;
  3565.             TabButton.BackgroundColor3 = Library.BackgroundColor;
  3566.             Library.RegistryMap[TabButton].Properties.BackgroundColor3 = 'BackgroundColor';
  3567.             TabFrame.Visible = false;
  3568.         end;
  3569.  
  3570.         function Tab:SetLayoutOrder(Position)
  3571.             TabButton.LayoutOrder = Position;
  3572.             TabListLayout:ApplyLayout();
  3573.         end;
  3574.  
  3575.         function Tab:GetSides()
  3576.             return { ["Left"] = LeftSide, ["Right"] = RightSide };
  3577.         end;
  3578.  
  3579.         function Tab:AddGroupbox(Info)
  3580.             local Groupbox = {};
  3581.  
  3582.             local BoxOuter = Library:Create('Frame', {
  3583.                 BackgroundColor3 = Library.BackgroundColor;
  3584.                 BorderColor3 = Library.OutlineColor;
  3585.                 BorderMode = Enum.BorderMode.Inset;
  3586.                 Size = UDim2.new(1, 0, 0, 507 + 2);
  3587.                 ZIndex = 2;
  3588.                 Parent = Info.Side == 1 and LeftSide or RightSide;
  3589.             });
  3590.  
  3591.             Library:AddToRegistry(BoxOuter, {
  3592.                 BackgroundColor3 = 'BackgroundColor';
  3593.                 BorderColor3 = 'OutlineColor';
  3594.             });
  3595.  
  3596.             local BoxInner = Library:Create('Frame', {
  3597.                 BackgroundColor3 = Library.BackgroundColor;
  3598.                 BorderColor3 = Color3.new(0, 0, 0);
  3599.                 -- BorderMode = Enum.BorderMode.Inset;
  3600.                 Size = UDim2.new(1, -2, 1, -2);
  3601.                 Position = UDim2.new(0, 1, 0, 1);
  3602.                 ZIndex = 4;
  3603.                 Parent = BoxOuter;
  3604.             });
  3605.  
  3606.             Library:AddToRegistry(BoxInner, {
  3607.                 BackgroundColor3 = 'BackgroundColor';
  3608.             });
  3609.  
  3610.             local Highlight = Library:Create('Frame', {
  3611.                 BackgroundColor3 = Library.AccentColor;
  3612.                 BorderSizePixel = 0;
  3613.                 Size = UDim2.new(1, 0, 0, 2);
  3614.                 ZIndex = 5;
  3615.                 Parent = BoxInner;
  3616.             });
  3617.  
  3618.             Library:AddToRegistry(Highlight, {
  3619.                 BackgroundColor3 = 'AccentColor';
  3620.             });
  3621.  
  3622.             local GroupboxLabel = Library:CreateLabel({
  3623.                 Size = UDim2.new(1, 0, 0, 18);
  3624.                 Position = UDim2.new(0, 4, 0, 2);
  3625.                 TextSize = 14;
  3626.                 Text = Info.Name;
  3627.                 TextXAlignment = Enum.TextXAlignment.Left;
  3628.                 ZIndex = 5;
  3629.                 Parent = BoxInner;
  3630.             });
  3631.  
  3632.             local Container = Library:Create('Frame', {
  3633.                 BackgroundTransparency = 1;
  3634.                 Position = UDim2.new(0, 4, 0, 20);
  3635.                 Size = UDim2.new(1, -4, 1, -20);
  3636.                 ZIndex = 1;
  3637.                 Parent = BoxInner;
  3638.             });
  3639.  
  3640.             Library:Create('UIListLayout', {
  3641.                 FillDirection = Enum.FillDirection.Vertical;
  3642.                 SortOrder = Enum.SortOrder.LayoutOrder;
  3643.                 Parent = Container;
  3644.             });
  3645.  
  3646.             function Groupbox:Resize()
  3647.                 local Size = 0;
  3648.  
  3649.                 for _, Element in next, Groupbox.Container:GetChildren() do
  3650.                     if (not Element:IsA('UIListLayout')) and Element.Visible then
  3651.                         Size = Size + Element.Size.Y.Offset;
  3652.                     end;
  3653.                 end;
  3654.  
  3655.                 BoxOuter.Size = UDim2.new(1, 0, 0, 20 + Size + 2 + 2);
  3656.             end;
  3657.  
  3658.             Groupbox.Container = Container;
  3659.             setmetatable(Groupbox, BaseGroupbox);
  3660.  
  3661.             Groupbox:AddBlank(3);
  3662.             Groupbox:Resize();
  3663.  
  3664.             Tab.Groupboxes[Info.Name] = Groupbox;
  3665.  
  3666.             return Groupbox;
  3667.         end;
  3668.  
  3669.         function Tab:AddLeftGroupbox(Name)
  3670.             return Tab:AddGroupbox({ Side = 1; Name = Name; });
  3671.         end;
  3672.  
  3673.         function Tab:AddRightGroupbox(Name)
  3674.             return Tab:AddGroupbox({ Side = 2; Name = Name; });
  3675.         end;
  3676.  
  3677.         function Tab:AddTabbox(Info)
  3678.             local Tabbox = {
  3679.                 Tabs = {};
  3680.             };
  3681.  
  3682.             local BoxOuter = Library:Create('Frame', {
  3683.                 BackgroundColor3 = Library.BackgroundColor;
  3684.                 BorderColor3 = Library.OutlineColor;
  3685.                 BorderMode = Enum.BorderMode.Inset;
  3686.                 Size = UDim2.new(1, 0, 0, 0);
  3687.                 ZIndex = 2;
  3688.                 Parent = Info.Side == 1 and LeftSide or RightSide;
  3689.             });
  3690.  
  3691.             Library:AddToRegistry(BoxOuter, {
  3692.                 BackgroundColor3 = 'BackgroundColor';
  3693.                 BorderColor3 = 'OutlineColor';
  3694.             });
  3695.  
  3696.             local BoxInner = Library:Create('Frame', {
  3697.                 BackgroundColor3 = Library.BackgroundColor;
  3698.                 BorderColor3 = Color3.new(0, 0, 0);
  3699.                 -- BorderMode = Enum.BorderMode.Inset;
  3700.                 Size = UDim2.new(1, -2, 1, -2);
  3701.                 Position = UDim2.new(0, 1, 0, 1);
  3702.                 ZIndex = 4;
  3703.                 Parent = BoxOuter;
  3704.             });
  3705.  
  3706.             Library:AddToRegistry(BoxInner, {
  3707.                 BackgroundColor3 = 'BackgroundColor';
  3708.             });
  3709.  
  3710.             local Highlight = Library:Create('Frame', {
  3711.                 BackgroundColor3 = Library.AccentColor;
  3712.                 BorderSizePixel = 0;
  3713.                 Size = UDim2.new(1, 0, 0, 2);
  3714.                 ZIndex = 10;
  3715.                 Parent = BoxInner;
  3716.             });
  3717.  
  3718.             Library:AddToRegistry(Highlight, {
  3719.                 BackgroundColor3 = 'AccentColor';
  3720.             });
  3721.  
  3722.             local TabboxButtons = Library:Create('Frame', {
  3723.                 BackgroundTransparency = 1;
  3724.                 Position = UDim2.new(0, 0, 0, 1);
  3725.                 Size = UDim2.new(1, 0, 0, 18);
  3726.                 ZIndex = 5;
  3727.                 Parent = BoxInner;
  3728.             });
  3729.  
  3730.             Library:Create('UIListLayout', {
  3731.                 FillDirection = Enum.FillDirection.Horizontal;
  3732.                 HorizontalAlignment = Enum.HorizontalAlignment.Left;
  3733.                 SortOrder = Enum.SortOrder.LayoutOrder;
  3734.                 Parent = TabboxButtons;
  3735.             });
  3736.  
  3737.             function Tabbox:AddTab(Name)
  3738.                 local Tab = {};
  3739.  
  3740.                 local Button = Library:Create('Frame', {
  3741.                     BackgroundColor3 = Library.MainColor;
  3742.                     BorderColor3 = Color3.new(0, 0, 0);
  3743.                     Size = UDim2.new(0.5, 0, 1, 0);
  3744.                     ZIndex = 6;
  3745.                     Parent = TabboxButtons;
  3746.                 });
  3747.  
  3748.                 Library:AddToRegistry(Button, {
  3749.                     BackgroundColor3 = 'MainColor';
  3750.                 });
  3751.  
  3752.                 local ButtonLabel = Library:CreateLabel({
  3753.                     Size = UDim2.new(1, 0, 1, 0);
  3754.                     TextSize = 14;
  3755.                     Text = Name;
  3756.                     TextXAlignment = Enum.TextXAlignment.Center;
  3757.                     ZIndex = 7;
  3758.                     Parent = Button;
  3759.                 });
  3760.  
  3761.                 local Block = Library:Create('Frame', {
  3762.                     BackgroundColor3 = Library.BackgroundColor;
  3763.                     BorderSizePixel = 0;
  3764.                     Position = UDim2.new(0, 0, 1, 0);
  3765.                     Size = UDim2.new(1, 0, 0, 1);
  3766.                     Visible = false;
  3767.                     ZIndex = 9;
  3768.                     Parent = Button;
  3769.                 });
  3770.  
  3771.                 Library:AddToRegistry(Block, {
  3772.                     BackgroundColor3 = 'BackgroundColor';
  3773.                 });
  3774.  
  3775.                 local Container = Library:Create('Frame', {
  3776.                     BackgroundTransparency = 1;
  3777.                     Position = UDim2.new(0, 4, 0, 20);
  3778.                     Size = UDim2.new(1, -4, 1, -20);
  3779.                     ZIndex = 1;
  3780.                     Visible = false;
  3781.                     Parent = BoxInner;
  3782.                 });
  3783.  
  3784.                 Library:Create('UIListLayout', {
  3785.                     FillDirection = Enum.FillDirection.Vertical;
  3786.                     SortOrder = Enum.SortOrder.LayoutOrder;
  3787.                     Parent = Container;
  3788.                 });
  3789.  
  3790.                 function Tab:Show()
  3791.                     for _, Tab in next, Tabbox.Tabs do
  3792.                         Tab:Hide();
  3793.                     end;
  3794.  
  3795.                     Container.Visible = true;
  3796.                     Block.Visible = true;
  3797.  
  3798.                     Button.BackgroundColor3 = Library.BackgroundColor;
  3799.                     Library.RegistryMap[Button].Properties.BackgroundColor3 = 'BackgroundColor';
  3800.  
  3801.                     Tab:Resize();
  3802.                 end;
  3803.  
  3804.                 function Tab:Hide()
  3805.                     Container.Visible = false;
  3806.                     Block.Visible = false;
  3807.  
  3808.                     Button.BackgroundColor3 = Library.MainColor;
  3809.                     Library.RegistryMap[Button].Properties.BackgroundColor3 = 'MainColor';
  3810.                 end;
  3811.  
  3812.                 function Tab:Resize()
  3813.                     local TabCount = 0;
  3814.  
  3815.                     for _, Tab in next, Tabbox.Tabs do
  3816.                         TabCount = TabCount + 1;
  3817.                     end;
  3818.  
  3819.                     for _, Button in next, TabboxButtons:GetChildren() do
  3820.                         if not Button:IsA('UIListLayout') then
  3821.                             Button.Size = UDim2.new(1 / TabCount, 0, 1, 0);
  3822.                         end;
  3823.                     end;
  3824.  
  3825.                     if (not Container.Visible) then
  3826.                         return;
  3827.                     end;
  3828.  
  3829.                     local Size = 0;
  3830.  
  3831.                     for _, Element in next, Tab.Container:GetChildren() do
  3832.                         if (not Element:IsA('UIListLayout')) and Element.Visible then
  3833.                             Size = Size + Element.Size.Y.Offset;
  3834.                         end;
  3835.                     end;
  3836.  
  3837.                     BoxOuter.Size = UDim2.new(1, 0, 0, 20 + Size + 2 + 2);
  3838.                 end;
  3839.  
  3840.                 Button.InputBegan:Connect(function(Input)
  3841.                     if (Input.UserInputType == Enum.UserInputType.MouseButton1 and not Library:MouseIsOverOpenedFrame()) or Input.UserInputType == Enum.UserInputType.Touch then
  3842.                         Tab:Show();
  3843.                         Tab:Resize();
  3844.                     end;
  3845.                 end);
  3846.  
  3847.                 Tab.Container = Container;
  3848.                 Tabbox.Tabs[Name] = Tab;
  3849.  
  3850.                 setmetatable(Tab, BaseGroupbox);
  3851.  
  3852.                 Tab:AddBlank(3);
  3853.                 Tab:Resize();
  3854.  
  3855.                 -- Show first tab (number is 2 cus of the UIListLayout that also sits in that instance)
  3856.                 if #TabboxButtons:GetChildren() == 2 then
  3857.                     Tab:Show();
  3858.                 end;
  3859.  
  3860.                 return Tab;
  3861.             end;
  3862.  
  3863.             Tab.Tabboxes[Info.Name or ''] = Tabbox;
  3864.  
  3865.             return Tabbox;
  3866.         end;
  3867.  
  3868.         function Tab:AddLeftTabbox(Name)
  3869.             return Tab:AddTabbox({ Name = Name, Side = 1; });
  3870.         end;
  3871.  
  3872.         function Tab:AddRightTabbox(Name)
  3873.             return Tab:AddTabbox({ Name = Name, Side = 2; });
  3874.         end;
  3875.  
  3876.         TabButton.InputBegan:Connect(function(Input)
  3877.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  3878.                 Tab:ShowTab();
  3879.             end;
  3880.         end);
  3881.  
  3882.         -- This was the first tab added, so we show it by default.
  3883.     Library.TotalTabs = Library.TotalTabs + 1;
  3884.         if Library.TotalTabs == 1 then
  3885.             Tab:ShowTab();
  3886.         end;
  3887.  
  3888.         Window.Tabs[Name] = Tab;
  3889.         return Tab;
  3890.     end;
  3891.  
  3892.     local ModalElement = Library:Create('TextButton', {
  3893.         BackgroundTransparency = 1;
  3894.         Size = UDim2.new(0, 0, 0, 0);
  3895.         Visible = true;
  3896.         Text = '';
  3897.         Modal = false;
  3898.         Parent = ScreenGui;
  3899.     });
  3900.  
  3901.     local TransparencyCache = {};
  3902.     local Toggled = false;
  3903.     local Fading = false;
  3904.    
  3905.     function Library:Toggle()
  3906.         if Fading then
  3907.             return;
  3908.         end;
  3909.  
  3910.         local FadeTime = Config.MenuFadeTime;
  3911.         Fading = true;
  3912.         Toggled = (not Toggled);
  3913.         Library.Toggled = Toggled;
  3914.         ModalElement.Modal = Toggled;
  3915.  
  3916.         if Toggled then
  3917.             -- A bit scuffed, but if we're going from not toggled -> toggled we want to show the frame immediately so that the fade is visible.
  3918.             Outer.Visible = true;
  3919.  
  3920.             if Library.ShowCustomCursor and Drawing then
  3921.                 local Cursor = Drawing.new("Triangle")
  3922.                 Cursor.Thickness = 1
  3923.                 Cursor.Filled = true
  3924.                 Cursor.Visible = true
  3925.                 local CursorOutline = Drawing.new("Triangle")
  3926.                 CursorOutline.Thickness = 1
  3927.                 CursorOutline.Filled = false
  3928.                 CursorOutline.Color = Color3.new(0, 0, 0)
  3929.                 CursorOutline.Visible = true
  3930.                
  3931.                 local OldMouseIconState = InputService.MouseIconEnabled
  3932.                 RunService:BindToRenderStep("LinoriaCursor", Enum.RenderPriority.Camera.Value - 1, function()
  3933.                     InputService.MouseIconEnabled = false
  3934.                     local mPos = InputService:GetMouseLocation()
  3935.                     local X, Y = mPos.X, mPos.Y
  3936.                     Cursor.Color = Library.AccentColor
  3937.                     Cursor.PointA = Vector2.new(X, Y)
  3938.                     Cursor.PointB = Vector2.new(X + 16, Y + 6)
  3939.                     Cursor.PointC = Vector2.new(X + 6, Y + 16)
  3940.                     CursorOutline.PointA = Cursor.PointA
  3941.                     CursorOutline.PointB = Cursor.PointB
  3942.                     CursorOutline.PointC = Cursor.PointC
  3943.                     if not (Toggled and ScreenGui.Parent and Library.ShowCustomCursor) then
  3944.                         InputService.MouseIconEnabled = OldMouseIconState
  3945.                         Cursor:Destroy()
  3946.                         CursorOutline:Destroy()
  3947.                         RunService:UnbindFromRenderStep("LinoriaCursor")
  3948.                     end
  3949.                 end)
  3950.             end
  3951.         end;
  3952.  
  3953.         for _, Option in Options do
  3954.             if Option.Type == 'Dropdown' then
  3955.                 Option:CloseDropdown()
  3956.             end
  3957.         end
  3958.  
  3959.         for _, Desc in next, Outer:GetDescendants() do
  3960.             local Properties = {};
  3961.  
  3962.             if Desc:IsA('ImageLabel') then
  3963.                 table.insert(Properties, 'ImageTransparency');
  3964.                 table.insert(Properties, 'BackgroundTransparency');
  3965.             elseif Desc:IsA('TextLabel') or Desc:IsA('TextBox') then
  3966.                 table.insert(Properties, 'TextTransparency');
  3967.             elseif Desc:IsA('Frame') or Desc:IsA('ScrollingFrame') then
  3968.                 table.insert(Properties, 'BackgroundTransparency');
  3969.             elseif Desc:IsA('UIStroke') then
  3970.                 table.insert(Properties, 'Transparency');
  3971.             end;
  3972.  
  3973.             local Cache = TransparencyCache[Desc];
  3974.  
  3975.             if (not Cache) then
  3976.                 Cache = {};
  3977.                 TransparencyCache[Desc] = Cache;
  3978.             end;
  3979.  
  3980.             for _, Prop in next, Properties do
  3981.                 if not Cache[Prop] then
  3982.                     Cache[Prop] = Desc[Prop];
  3983.                 end;
  3984.  
  3985.                 if Cache[Prop] == 1 then
  3986.                     continue;
  3987.                 end;
  3988.  
  3989.                 TweenService:Create(Desc, TweenInfo.new(FadeTime, Enum.EasingStyle.Linear), { [Prop] = Toggled and Cache[Prop] or 1 }):Play();
  3990.             end;
  3991.         end;
  3992.  
  3993.         task.wait(FadeTime);
  3994.  
  3995.         Outer.Visible = Toggled;
  3996.  
  3997.         Fading = false;
  3998.     end
  3999.  
  4000.     Library:GiveSignal(InputService.InputBegan:Connect(function(Input, Processed)
  4001.         if type(Library.ToggleKeybind) == 'table' and Library.ToggleKeybind.Type == 'KeyPicker' then
  4002.             if Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode.Name == Library.ToggleKeybind.Value then
  4003.                 task.spawn(Library.Toggle)
  4004.             end
  4005.         elseif Input.KeyCode == Enum.KeyCode.RightControl or (Input.KeyCode == Enum.KeyCode.RightShift and (not Processed)) then
  4006.             task.spawn(Library.Toggle)
  4007.         end
  4008.     end));
  4009.  
  4010.     if Library.IsMobile then
  4011.         local ToggleUIOuter = Library:Create('Frame', {
  4012.             BorderColor3 = Color3.new(0, 0, 0);
  4013.             Position = UDim2.new(0.008, 0, 0.301, 0);
  4014.             Size = UDim2.new(0, 77, 0, 30);
  4015.             ZIndex = 200;
  4016.             Visible = true;
  4017.             Parent = ScreenGui;
  4018.         });
  4019.    
  4020.         local ToggleUIInner = Library:Create('Frame', {
  4021.             BackgroundColor3 = Library.MainColor;
  4022.             BorderColor3 = Library.AccentColor;
  4023.             BorderMode = Enum.BorderMode.Inset;
  4024.             Size = UDim2.new(1, 0, 1, 0);
  4025.             ZIndex = 201;
  4026.             Parent = ToggleUIOuter;
  4027.         });
  4028.    
  4029.         Library:AddToRegistry(ToggleUIInner, {
  4030.             BorderColor3 = 'AccentColor';
  4031.         });
  4032.    
  4033.         local ToggleUIInnerFrame = Library:Create('Frame', {
  4034.             BackgroundColor3 = Color3.new(1, 1, 1);
  4035.             BorderSizePixel = 0;
  4036.             Position = UDim2.new(0, 1, 0, 1);
  4037.             Size = UDim2.new(1, -2, 1, -2);
  4038.             ZIndex = 202;
  4039.             Parent = ToggleUIInner;
  4040.         });
  4041.    
  4042.         local ToggleUIGradient = Library:Create('UIGradient', {
  4043.             Color = ColorSequence.new({
  4044.                 ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  4045.                 ColorSequenceKeypoint.new(1, Library.MainColor),
  4046.             });
  4047.             Rotation = -90;
  4048.             Parent = ToggleUIInnerFrame;
  4049.         });
  4050.    
  4051.         Library:AddToRegistry(ToggleUIGradient, {
  4052.             Color = function()
  4053.                 return ColorSequence.new({
  4054.                     ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  4055.                     ColorSequenceKeypoint.new(1, Library.MainColor),
  4056.                 });
  4057.             end
  4058.         });
  4059.    
  4060.         local ToggleUIButton = Library:Create('TextButton', {
  4061.             Position = UDim2.new(0, 5, 0, 0);
  4062.             Size = UDim2.new(1, -4, 1, 0);
  4063.             BackgroundTransparency = 1;
  4064.             Font = Library.Font;
  4065.             Text = "Toggle UI";
  4066.             TextColor3 = Library.FontColor;
  4067.             TextSize = 14;
  4068.             TextXAlignment = Enum.TextXAlignment.Left;
  4069.             TextStrokeTransparency = 0;
  4070.             ZIndex = 203;
  4071.             Parent = ToggleUIInnerFrame;
  4072.         });
  4073.    
  4074.         Library:MakeDraggable(ToggleUIOuter);
  4075.  
  4076.         ToggleUIButton.MouseButton1Down:Connect(function()
  4077.             task.spawn(Library.Toggle)
  4078.         end)
  4079.  
  4080.     -- Lock
  4081.     local LockUIOuter = Library:Create('Frame', {
  4082.             BorderColor3 = Color3.new(0, 0, 0);
  4083.             Position = UDim2.new(0.008, 0, 0.358, 0);
  4084.             Size = UDim2.new(0, 77, 0, 30);
  4085.             ZIndex = 200;
  4086.             Visible = true;
  4087.             Parent = ScreenGui;
  4088.         });
  4089.    
  4090.         local LockUIInner = Library:Create('Frame', {
  4091.             BackgroundColor3 = Library.MainColor;
  4092.             BorderColor3 = Library.AccentColor;
  4093.             BorderMode = Enum.BorderMode.Inset;
  4094.             Size = UDim2.new(1, 0, 1, 0);
  4095.             ZIndex = 201;
  4096.             Parent = LockUIOuter;
  4097.         });
  4098.    
  4099.         Library:AddToRegistry(LockUIInner, {
  4100.             BorderColor3 = 'AccentColor';
  4101.         });
  4102.    
  4103.         local LockUIInnerFrame = Library:Create('Frame', {
  4104.             BackgroundColor3 = Color3.new(1, 1, 1);
  4105.             BorderSizePixel = 0;
  4106.             Position = UDim2.new(0, 1, 0, 1);
  4107.             Size = UDim2.new(1, -2, 1, -2);
  4108.             ZIndex = 202;
  4109.             Parent = LockUIInner;
  4110.         });
  4111.    
  4112.         local LockUIGradient = Library:Create('UIGradient', {
  4113.             Color = ColorSequence.new({
  4114.                 ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  4115.                 ColorSequenceKeypoint.new(1, Library.MainColor),
  4116.             });
  4117.             Rotation = -90;
  4118.             Parent = LockUIInnerFrame;
  4119.         });
  4120.    
  4121.         Library:AddToRegistry(LockUIGradient, {
  4122.             Color = function()
  4123.                 return ColorSequence.new({
  4124.                     ColorSequenceKeypoint.new(0, Library:GetDarkerColor(Library.MainColor)),
  4125.                     ColorSequenceKeypoint.new(1, Library.MainColor),
  4126.                 });
  4127.             end
  4128.         });
  4129.    
  4130.         local LockUIButton = Library:Create('TextButton', {
  4131.             Position = UDim2.new(0, 5, 0, 0);
  4132.             Size = UDim2.new(1, -4, 1, 0);
  4133.             BackgroundTransparency = 1;
  4134.             Font = Library.Font;
  4135.             Text = "Unlock UI";
  4136.             TextColor3 = Library.FontColor;
  4137.             TextSize = 14;
  4138.             TextXAlignment = Enum.TextXAlignment.Left;
  4139.             TextStrokeTransparency = 0;
  4140.             ZIndex = 203;
  4141.             Parent = LockUIInnerFrame;
  4142.         });
  4143.  
  4144.         Library:MakeDraggable(LockUIOuter);
  4145.  
  4146.         Library.CantDragForced = true
  4147.  
  4148.         LockUIButton.MouseButton1Down:Connect(function()
  4149.             Library.CantDragForced = not Library.CantDragForced
  4150.                 if Library.CantDragForced then
  4151.                  LockUIButton.Text = "Unlock UI"
  4152.             else
  4153.                  LockUIButton.Text = "Lock UI"
  4154.             end
  4155.         end)
  4156.     end;
  4157.  
  4158.     if Config.AutoShow then task.spawn(Library.Toggle) end
  4159.  
  4160.     Window.Holder = Outer;
  4161.  
  4162.     Library.Window = Window;
  4163.     return Window;
  4164. end;
  4165.  
  4166. local function OnPlayerChange()
  4167.     local PlayerList = GetPlayersString();
  4168.  
  4169.     for _, Value in next, Options do
  4170.         if Value.Type == 'Dropdown' and Value.SpecialType == 'Player' then
  4171.             Value:SetValues(PlayerList);
  4172.         end;
  4173.     end;
  4174. end;
  4175.  
  4176. Players.PlayerAdded:Connect(OnPlayerChange);
  4177. Players.PlayerRemoving:Connect(OnPlayerChange);
  4178.  
  4179. getgenv().Library = Library
  4180. return Library
  4181.  
Add Comment
Please, Sign In to add comment