Advertisement
DuyOnline101

Wally ui MODIFIED

Aug 14th, 2023
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 62.92 KB | None | 0 0
  1. local library = {count = 0, queue = {}, callbacks = {}, rainbowtable = {}, toggled = true, binds = {}};
  2. local defaults; do
  3.     local dragger = {}; do
  4.         local mouse        = game:GetService("Players").LocalPlayer:GetMouse();
  5.         local inputService = game:GetService('UserInputService');
  6.         local heartbeat    = game:GetService("RunService").Heartbeat;
  7.         -- // credits to Ririchi / Inori for this cute drag function :)
  8.         function dragger.new(frame)
  9.             local s, event = pcall(function()
  10.                 return frame.MouseEnter
  11.             end)
  12.    
  13.             if s then
  14.                 frame.Active = true;
  15.                
  16.                 event:connect(function()
  17.                     local input = frame.InputBegan:connect(function(key)
  18.                         if key.UserInputType == Enum.UserInputType.MouseButton1 then
  19.                             local objectPosition = Vector2.new(mouse.X - frame.AbsolutePosition.X, mouse.Y - frame.AbsolutePosition.Y);
  20.                             while heartbeat:wait() and inputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  21.                                 pcall(function()
  22.                                     frame:TweenPosition(UDim2.new(0, mouse.X - objectPosition.X + (frame.Size.X.Offset * frame.AnchorPoint.X), 0, mouse.Y - objectPosition.Y + (frame.Size.Y.Offset * frame.AnchorPoint.Y)), 'Out', 'Linear', 0.1, true);
  23.                                 end)
  24.                             end
  25.                         end
  26.                     end)
  27.    
  28.                     local leave;
  29.                     leave = frame.MouseLeave:connect(function()
  30.                         input:disconnect();
  31.                         leave:disconnect();
  32.                     end)
  33.                 end)
  34.             end
  35.         end
  36.  
  37.         game:GetService('UserInputService').InputBegan:connect(function(key, gpe)
  38.             if (not gpe) then
  39.                 if key.KeyCode == Enum.KeyCode.RightControl then
  40.                     library.toggled = not library.toggled;
  41.                     for i, data in next, library.queue do
  42.                         local pos = (library.toggled and data.p or UDim2.new(-1, 0, -0.5,0))
  43.                         data.w:TweenPosition(pos, (library.toggled and 'Out' or 'In'), 'Quad', 0.15, true)
  44.                         wait();
  45.                     end
  46.                 end
  47.             end
  48.         end)
  49.     end
  50.    
  51.     local types = {}; do
  52.         types.__index = types;
  53.         function types.window(name, options)
  54.             library.count = library.count + 1
  55.             local newWindow = library:Create('Frame', {
  56.                 Name = name;
  57.                 Size = UDim2.new(0, 190, 0, 30);
  58.                 BackgroundColor3 = options.topcolor;
  59.                 BorderSizePixel = 0;
  60.                 Parent = library.container;
  61.                 Position = UDim2.new(0, (15 + (200 * library.count) - 200), 0, 0);
  62.                 ZIndex = 3;
  63.                 library:Create('TextLabel', {
  64.                     Text = name;
  65.                     Size = UDim2.new(1, -10, 1, 0);
  66.                     Position = UDim2.new(0, 5, 0, 0);
  67.                     BackgroundTransparency = 1;
  68.                     Font = Enum.Font.Code;
  69.                     TextSize = options.titlesize;
  70.                     Font = options.titlefont;
  71.                     TextColor3 = options.titletextcolor;
  72.                     TextStrokeTransparency = library.options.titlestroke;
  73.                     TextStrokeColor3 = library.options.titlestrokecolor;
  74.                     ZIndex = 3;
  75.                 });
  76.                 library:Create("TextButton", {
  77.                     Size = UDim2.new(0, 30, 0, 30);
  78.                     Position = UDim2.new(1, -35, 0, 0);
  79.                     BackgroundTransparency = 1;
  80.                     Text = "-";
  81.                     TextSize = options.titlesize;
  82.                     Font = options.titlefont;--Enum.Font.Code;
  83.                     Name = 'window_toggle';
  84.                     TextColor3 = options.titletextcolor;
  85.                     TextStrokeTransparency = library.options.titlestroke;
  86.                     TextStrokeColor3 = library.options.titlestrokecolor;
  87.                     ZIndex = 3;
  88.                 });
  89.                 library:Create("Frame", {
  90.                     Name = 'Underline';
  91.                     Size = UDim2.new(1, 0, 0, 2);
  92.                     Position = UDim2.new(0, 0, 1, -2);
  93.                     BackgroundColor3 = (options.underlinecolor ~= "rainbow" and options.underlinecolor or Color3.new());
  94.                     BorderSizePixel = 0;
  95.                     ZIndex = 3;
  96.                 });
  97.                 library:Create('Frame', {
  98.                     Name = 'container';
  99.                     Position = UDim2.new(0, 0, 1, 0);
  100.                     Size = UDim2.new(1, 0, 0, 0);
  101.                     BorderSizePixel = 0;
  102.                     BackgroundColor3 = options.bgcolor;
  103.                     ClipsDescendants = false;
  104.                     library:Create('UIListLayout', {
  105.                         Name = 'List';
  106.                         SortOrder = Enum.SortOrder.LayoutOrder;
  107.                     })
  108.                 });
  109.             })
  110.            
  111.             if options.underlinecolor == "rainbow" then
  112.                 library.rainbowtable[newWindow:FindFirstChild('Underline')] = newWindow:FindFirstChild('Underline')
  113.             end
  114.  
  115.             local window = setmetatable({
  116.                 count = 0;
  117.                 object = newWindow;
  118.                 container = newWindow.container;
  119.                 toggled = true;
  120.                 flags   = {};
  121.  
  122.             }, types)
  123.  
  124.             table.insert(library.queue, {
  125.                 w = window.object;
  126.                 p = window.object.Position;
  127.             })
  128.  
  129.             newWindow:FindFirstChild("window_toggle").MouseButton1Click:connect(function()
  130.                 window.toggled = not window.toggled;
  131.                 newWindow:FindFirstChild("window_toggle").Text = (window.toggled and "+" or "-")
  132.                 if (not window.toggled) then
  133.                     window.container.ClipsDescendants = true;
  134.                 end
  135.                 wait();
  136.                 local y = 0;
  137.                 for i, v in next, window.container:GetChildren() do
  138.                     if (not v:IsA('UIListLayout')) then
  139.                         y = y + v.AbsoluteSize.Y;
  140.                     end
  141.                 end
  142.  
  143.                 local targetSize = window.toggled and UDim2.new(1, 0, 0, y+5) or UDim2.new(1, 0, 0, 0);
  144.                 local targetDirection = window.toggled and "In" or "Out"
  145.  
  146.                 window.container:TweenSize(targetSize, targetDirection, "Quad", 0.15, true)
  147.                 wait(.15)
  148.                 if window.toggled then
  149.                     window.container.ClipsDescendants = false;
  150.                 end
  151.             end)
  152.  
  153.             return window;
  154.         end
  155.        
  156.         function types:Resize()
  157.             local y = 0;
  158.             for i, v in next, self.container:GetChildren() do
  159.                 if (not v:IsA('UIListLayout')) then
  160.                     y = y + v.AbsoluteSize.Y;
  161.                 end
  162.             end
  163.             self.container.Size = UDim2.new(1, 0, 0, y+5)
  164.         end
  165.        
  166.         function types:GetOrder()
  167.             local c = 0;
  168.             for i, v in next, self.container:GetChildren() do
  169.                 if (not v:IsA('UIListLayout')) then
  170.                     c = c + 1
  171.                 end
  172.             end
  173.             return c
  174.         end
  175.        
  176.         function types:Label(display,rainbow)
  177.             local v = game:GetService'TextService':GetTextSize(display, 18, Enum.Font.SourceSans, Vector2.new(math.huge, math.huge))
  178.             local object = library:Create('Frame', {
  179.                 Size = UDim2.new(1, 0, 0, v.Y+5);
  180.                 BackgroundTransparency  = 1;
  181.                 LayoutOrder = self:GetOrder();
  182.                 library:Create('TextLabel', {
  183.                
  184.                     Position = UDim2.new(0, 10, 0, 0);
  185.                     Size = UDim2.new(1, 0, 1, 0);
  186.                     TextSize = 18;
  187.                     Font = Enum.Font.SourceSans;
  188.                     TextColor3 = Color3.fromRGB(255, 255, 255);
  189.                     BackgroundTransparency = 1;
  190.                     TextXAlignment = Enum.TextXAlignment.Left;
  191.                     TextWrapped = true;
  192.                     Text = display;
  193.                 });
  194.                 Parent = self.container;
  195.             })
  196.  
  197.             self:Resize();
  198.             if rainbow then
  199.                 library.rainbowtable[object:FindFirstChild('TextLabel')] = object:FindFirstChild('TextLabel')
  200.             end
  201.            
  202.             return object:FindFirstChild('TextLabel');
  203.         end
  204.  
  205.         function types:Toggle(name, options, callback)
  206.             options = options or {}
  207.             local default  = options.default or false;
  208.             local location = options.location or self.flags;
  209.             local flag     = options.flag or "";
  210.             local callback = callback or function() end;
  211.            
  212.             location[flag] = default;
  213.  
  214.             local check = library:Create('Frame', {
  215.                 BackgroundTransparency = 1;
  216.                 Size = UDim2.new(1, 0, 0, 25);
  217.                 LayoutOrder = self:GetOrder();
  218.                 library:Create('TextLabel', {
  219.                     Name = name;
  220.                     Text = "\r" .. name;
  221.                     BackgroundTransparency = 1;
  222.                     TextColor3 = library.options.textcolor;
  223.                     Position = UDim2.new(0, 5, 0, 0);
  224.                     Size     = UDim2.new(1, -5, 1, 0);
  225.                     TextXAlignment = Enum.TextXAlignment.Left;
  226.                     Font = library.options.font;
  227.                     TextSize = library.options.fontsize;
  228.                     TextStrokeTransparency = library.options.textstroke;
  229.                     TextStrokeColor3 = library.options.strokecolor;
  230.                     library:Create('TextButton', {
  231.                        
  232.                         Text = (library.options.toggledisplay == 'Check' and (location[flag] and utf8.char(10003) or "") or '');
  233.                         Font = library.options.font;
  234.                         TextSize = library.options.fontsize;
  235.                         Name = 'Checkmark';
  236.                         Size = UDim2.new(0, 20, 0, 20);
  237.                         Position = UDim2.new(1, -25, 0, 4);
  238.                         TextColor3 = library.options.textcolor;
  239.                         BackgroundColor3 = (library.options.toggledisplay == 'Fill' and(location[flag] and Color3.fromRGB(20,148,90) or Color3.fromRGB(175,35,35)) or library.options.bgcolor);
  240.                         BorderColor3 = library.options.bordercolor;
  241.                         TextStrokeTransparency = library.options.textstroke;
  242.                         TextStrokeColor3 = library.options.strokecolor;
  243.                     })
  244.                 });
  245.                 Parent = self.container;
  246.             });
  247.                
  248.             local function click(t)
  249.                 location[flag] = (not location[flag]);
  250.                 callback(location[flag])
  251.                 if library.options.toggledisplay == 'Check' then
  252.                     check:FindFirstChild(name).Checkmark.Text = location[flag] and utf8.char(10003) or "";
  253.                 elseif library.options.toggledisplay == 'Fill' then
  254.                     check:FindFirstChild(name).Checkmark.BackgroundColor3 = location[flag] and Color3.fromRGB(20,148,90) or Color3.fromRGB(175,35,35)
  255.                 end
  256.             end
  257.  
  258.             check:FindFirstChild(name).Checkmark.MouseButton1Click:connect(click)
  259.             library.callbacks[flag] = click;
  260.  
  261.             if location[flag] == true then
  262.                 callback(location[flag])
  263.             end
  264.  
  265.             self:Resize();
  266.             return {
  267.                 Set = function(b)
  268.                     location[flag] = b;
  269.                     callback(location[flag])
  270.                     if library.options.toggledisplay == 'Check' then
  271.                         check:FindFirstChild(name).Checkmark.Text = location[flag] and utf8.char(10003) or "";
  272.                     elseif library.options.toggledisplay == 'Fill' then
  273.                         check:FindFirstChild(name).Checkmark.BackgroundColor3 = location[flag] and Color3.fromRGB(20,148,90) or Color3.fromRGB(175,35,35)
  274.                     end
  275.                 end
  276.             }
  277.         end
  278.  
  279.         function types:TypeBox(name, options, callback)
  280.             options = options or {}
  281.             local location = options.location or self.flags;
  282.             local flag     = options.flag or "";
  283.             local default = options.default or "";
  284.             local cleartext = options.cleartext or (options.cleartext == nil and true);
  285.             local callback = callback or function() end;
  286.  
  287.             location[flag] = default;
  288.    
  289.             local check = library:Create('Frame', {
  290.                 BackgroundTransparency = 1;
  291.                 Size = UDim2.new(1, 0, 0, 25);
  292.                 LayoutOrder = self:GetOrder();
  293.                 library:Create('TextBox', {
  294.                     Text = default;
  295.                     ClearTextOnFocus = cleartext;
  296.                     PlaceholderText = name;
  297.                     PlaceholderColor3 = Color3.fromRGB(60, 60, 60);
  298.                     Size = UDim2.new(1, -10, 0, 20);
  299.                     Position = UDim2.new(0, 5, 0, 4);
  300.                     BackgroundColor3 = library.options.boxcolor;
  301.                     ClipsDescendants = true;
  302.                     TextColor3 = library.options.textcolor;
  303.                     TextXAlignment = Enum.TextXAlignment.Center;
  304.                     TextSize = library.options.fontsize;
  305.                     Name = 'TextBox';
  306.                     Font = library.options.font;
  307.                     BorderColor3 = library.options.bordercolor;
  308.                     TextStrokeTransparency = library.options.textstroke;
  309.                     TextStrokeColor3 = library.options.strokecolor;
  310.                 });
  311.                 Parent = self.container;
  312.             });
  313.             local box = check:FindFirstChild('TextBox');
  314.             box:GetPropertyChangedSignal("Text"):Connect(function()
  315.                 if box.TextBounds.X >= box.AbsoluteSize.X then
  316.                     box.TextXAlignment = Enum.TextXAlignment.Right
  317.                 else
  318.                     box.TextXAlignment = Enum.TextXAlignment.Center
  319.                 end
  320.             end)
  321.             box.FocusLost:connect(function(e)
  322.                 local old = location[flag];
  323.                 location[flag] = tostring(box.Text)
  324.                 callback(location[flag], old, e)
  325.             end)
  326.             self:Resize();
  327.             return box
  328.         end
  329.  
  330.         function types:Button(name, callback)
  331.             callback = callback or function() end;
  332.            
  333.             local check = library:Create('Frame', {
  334.                 BackgroundTransparency = 1;
  335.                 Size = UDim2.new(1, 0, 0, 25);
  336.                 LayoutOrder = self:GetOrder();
  337.                 library:Create('TextButton', {
  338.                     Name = name;
  339.                     Text = name;
  340.                     BackgroundColor3 = library.options.btncolor;
  341.                     BorderColor3 = library.options.bordercolor;
  342.                     TextStrokeTransparency = library.options.textstroke;
  343.                     BackgroundTransparency = 0.35;
  344.                     TextStrokeColor3 = library.options.strokecolor;
  345.                     TextColor3 = library.options.textcolor;
  346.                     Position = UDim2.new(0, 5, 0, 5);
  347.                     Size     = UDim2.new(1, -10, 0, 20);
  348.                     Font = library.options.font;
  349.                     TextSize = library.options.fontsize;
  350.                 });
  351.                 Parent = self.container;
  352.             });
  353.            
  354.             check:FindFirstChild(name).MouseButton1Click:connect(callback)
  355.             self:Resize();
  356.  
  357.             return check:WaitForChild(name),{
  358.                 Fire = function()
  359.                     callback();
  360.                 end
  361.             }
  362.         end
  363.        
  364.         function types:Box(name, options, callback) --type, default, data, location, flag)
  365.             options = options or {}
  366.             local tipe   = options.type or "";
  367.             local default = options.default or "";
  368.             local data = options.data
  369.             local location = options.location or self.flags;
  370.             local flag     = options.flag or "";
  371.             local callback = callback or function() end;
  372.             local min      = options.min or 0;
  373.             local max      = options.max or 9e9;
  374.  
  375.             if tipe == 'number' and tonumber(default) ~= nil then
  376.                 location[flag] = default;
  377.             else
  378.                 location[flag] = "";
  379.                 default = "";
  380.             end
  381.  
  382.             local check = library:Create('Frame', {
  383.                 BackgroundTransparency = 1;
  384.                 Size = UDim2.new(1, 0, 0, 25);
  385.                 LayoutOrder = self:GetOrder();
  386.                 library:Create('TextLabel', {
  387.                     Name = name;
  388.                     Text = "\r" .. name;
  389.                     BackgroundTransparency = 1;
  390.                     TextColor3 = library.options.textcolor;
  391.                     TextStrokeTransparency = library.options.textstroke;
  392.                     TextStrokeColor3 = library.options.strokecolor;
  393.                     Position = UDim2.new(0, 5, 0, 0);
  394.                     Size     = UDim2.new(1, -5, 1, 0);
  395.                     TextXAlignment = Enum.TextXAlignment.Left;
  396.                     Font = library.options.font;
  397.                     TextSize = library.options.fontsize;
  398.                     library:Create('TextBox', {
  399.                         TextStrokeTransparency = library.options.textstroke;
  400.                         TextStrokeColor3 = library.options.strokecolor;
  401.                         Text = tostring(default);
  402.                         Font = library.options.font;
  403.                         TextSize = library.options.fontsize;
  404.                         Name = 'Box';
  405.                         Size = UDim2.new(0, 60, 0, 20);
  406.                         Position = UDim2.new(1, -65, 0, 3);
  407.                         TextColor3 = library.options.textcolor;
  408.                         BackgroundColor3 = library.options.boxcolor;
  409.                         BorderColor3 = library.options.bordercolor;
  410.                         PlaceholderColor3 = library.options.placeholdercolor;
  411.                     })
  412.                 });
  413.                 Parent = self.container;
  414.             });
  415.        
  416.             local box = check:FindFirstChild(name):FindFirstChild('Box');
  417.             box.FocusLost:connect(function(e)
  418.                 local old = location[flag];
  419.                 if tipe == "number" then
  420.                     local num = tonumber(box.Text)
  421.                     if (not num) then
  422.                         box.Text = tonumber(location[flag])
  423.                     else
  424.                         location[flag] = math.clamp(num, min, max)
  425.                         box.Text = tonumber(location[flag])
  426.                     end
  427.                 else
  428.                     location[flag] = tostring(box.Text)
  429.                 end
  430.  
  431.                 callback(location[flag], old, e)
  432.             end)
  433.            
  434.             if tipe == 'number' then
  435.                 box:GetPropertyChangedSignal('Text'):connect(function()
  436.                     box.Text = string.gsub(box.Text, "[%a+]", "");
  437.                 end)
  438.             end
  439.  
  440.             local function SetNew(new)
  441.                 if tipe == "number" then
  442.                     local num = tonumber(new)
  443.                     if (not num) then
  444.                         box.Text = tonumber(location[flag])
  445.                     else
  446.                         location[flag] = math.clamp(num, min, max)
  447.                         box.Text = tonumber(location[flag])
  448.                     end
  449.                 else
  450.                     location[flag] = tostring(box.Text)
  451.                 end
  452.             end
  453.            
  454.             self:Resize();
  455.             return {
  456.                 ['Box'] = box;
  457.                 ['SetNew'] = SetNew;
  458.             }
  459.         end
  460.        
  461.         function types:Bind(name, options, callback)
  462.             options = options or {}
  463.             local location     = options.location or self.flags;
  464.             local keyboardOnly = options.kbonly or false
  465.             local flag         = options.flag or "";
  466.             local callback     = callback or function() end;
  467.             local default      = options.default or nil;
  468.  
  469.             if keyboardOnly and (not tostring(default):find('MouseButton')) then
  470.                 location[flag] = default
  471.             end
  472.            
  473.             local banned = {
  474.                 Return = true;
  475.                 Space = true;
  476.                 Tab = true;
  477.                 Unknown = true;
  478.             }
  479.            
  480.             local shortNames = {
  481.                 RightControl = 'RightCtrl';
  482.                 LeftControl = 'LeftCtrl';
  483.                 LeftShift = 'LShift';
  484.                 RightShift = 'RShift';
  485.                 MouseButton1 = "Mouse1";
  486.                 MouseButton2 = "Mouse2";
  487.             }
  488.            
  489.             local allowed = {
  490.                 MouseButton1 = true;
  491.                 MouseButton2 = true;
  492.             }      
  493.  
  494.             local nm = (default and (shortNames[default.Name] or default.Name) or "None");
  495.             local check = library:Create('Frame', {
  496.                 BackgroundTransparency = 1;
  497.                 Size = UDim2.new(1, 0, 0, 30);
  498.                 LayoutOrder = self:GetOrder();
  499.                 library:Create('TextLabel', {
  500.                     Name = name;
  501.                     Text = "\r" .. name;
  502.                     BackgroundTransparency = 1;
  503.                     TextColor3 = library.options.textcolor;
  504.                     Position = UDim2.new(0, 5, 0, 0);
  505.                     Size     = UDim2.new(1, -5, 1, 0);
  506.                     TextXAlignment = Enum.TextXAlignment.Left;
  507.                     Font = library.options.font;
  508.                     TextSize = library.options.fontsize;
  509.                     TextStrokeTransparency = library.options.textstroke;
  510.                     TextStrokeColor3 = library.options.strokecolor;
  511.                     BorderColor3     = library.options.bordercolor;
  512.                     BorderSizePixel  = 1;
  513.                     library:Create('TextButton', {
  514.                         Name = 'Keybind';
  515.                         Text = nm;
  516.                         TextStrokeTransparency = library.options.textstroke;
  517.                         TextStrokeColor3 = library.options.strokecolor;
  518.                         Font = library.options.font;
  519.                         TextSize = library.options.fontsize;
  520.                         Size = UDim2.new(0, 60, 0, 20);
  521.                         Position = UDim2.new(1, -65, 0, 5);
  522.                         TextColor3 = library.options.textcolor;
  523.                         BackgroundColor3 = library.options.bgcolor;
  524.                         BorderColor3     = library.options.bordercolor;
  525.                         BorderSizePixel  = 1;
  526.                     })
  527.                 });
  528.                 Parent = self.container;
  529.             });
  530.                
  531.             local button = check:FindFirstChild(name).Keybind;
  532.             button.MouseButton1Click:connect(function()
  533.                 library.binding = true
  534.  
  535.                 button.Text = "..."
  536.                 local a, b = game:GetService('UserInputService').InputBegan:wait();
  537.                 local name = tostring(a.KeyCode.Name);
  538.                 local typeName = tostring(a.UserInputType.Name);
  539.  
  540.                 if (a.UserInputType ~= Enum.UserInputType.Keyboard and (allowed[a.UserInputType.Name]) and (not keyboardOnly)) or (a.KeyCode and (not banned[a.KeyCode.Name])) then
  541.                     local name = (a.UserInputType ~= Enum.UserInputType.Keyboard and a.UserInputType.Name or a.KeyCode.Name);
  542.                     location[flag] = (a);
  543.                     button.Text = shortNames[name] or name;
  544.                    
  545.                 else
  546.                     if (location[flag]) then
  547.                         if (not pcall(function()
  548.                             return location[flag].UserInputType
  549.                         end)) then
  550.                             local name = tostring(location[flag])
  551.                             button.Text = shortNames[name] or name
  552.                         else
  553.                             local name = (location[flag].UserInputType ~= Enum.UserInputType.Keyboard and location[flag].UserInputType.Name or location[flag].KeyCode.Name);
  554.                             button.Text = shortNames[name] or name;
  555.                         end
  556.                     end
  557.                 end
  558.  
  559.                 wait(0.1)  
  560.                 library.binding = false;
  561.             end)
  562.            
  563.             if location[flag] then
  564.                 button.Text = shortNames[tostring(location[flag].Name)] or tostring(location[flag].Name)
  565.             end
  566.  
  567.             library.binds[flag] = {
  568.                 location = location;
  569.                 callback = callback;
  570.             };
  571.  
  572.             self:Resize();
  573.         end
  574.    
  575.         function types:Section(name,rainbow)
  576.             local order = self:GetOrder();
  577.             local determinedSize = UDim2.new(1, 0, 0, 25)
  578.             local determinedPos = UDim2.new(0, 0, 0, 4);
  579.             local secondarySize = UDim2.new(1, 0, 0, 20);
  580.                        
  581.             if order == 0 then
  582.                 determinedSize = UDim2.new(1, 0, 0, 21)
  583.                 determinedPos = UDim2.new(0, 0, 0, -1);
  584.                 secondarySize = nil
  585.             end
  586.            
  587.             local check = library:Create('Frame', {
  588.                 Name = 'Section';
  589.                 BackgroundTransparency = 1;
  590.                 Size = determinedSize;
  591.                 BackgroundColor3 = library.options.sectncolor;
  592.                 BorderSizePixel = 0;
  593.                 LayoutOrder = order;
  594.                 library:Create('TextLabel', {
  595.                     Name = 'section_lbl';
  596.                     Text = name;
  597.                     BackgroundTransparency = 1;
  598.                     BorderSizePixel = 0;
  599.                     BackgroundColor3 = library.options.sectncolor;
  600.                     TextColor3 = library.options.textcolor;
  601.                     Position = determinedPos;
  602.                     Size     = (secondarySize or UDim2.new(1, 0, 1, 0));
  603.                     Font = library.options.font;
  604.                     TextSize = library.options.fontsize;
  605.                     TextStrokeTransparency = library.options.textstroke;
  606.                     TextStrokeColor3 = library.options.strokecolor;
  607.                 });
  608.                 Parent = self.container;
  609.             });
  610.        
  611.             self:Resize();
  612.             if rainbow then
  613.                 library.rainbowtable[check:FindFirstChild('section_lbl')] = check:FindFirstChild('section_lbl')
  614.             end
  615.             return check:FindFirstChild('section_lbl');
  616.         end
  617.  
  618.         function types:Slider(name, options, callback)
  619.             options = options or {}
  620.             local default = options.default or options.min or 0;
  621.             local min     = options.min or 0;
  622.             local max      = options.max or 1;
  623.             local location = options.location or self.flags;
  624.             local precise  = options.precise  or false -- e.g 0, 1 vs 0, 0.1, 0.2, ...
  625.             local flag     = options.flag or "";
  626.             local callback = callback or function() end
  627.  
  628.             location[flag] = default;
  629.  
  630.             local check = library:Create('Frame', {
  631.                 BackgroundTransparency = 1;
  632.                 Size = UDim2.new(1, 0, 0, 25);
  633.                 LayoutOrder = self:GetOrder();
  634.                 library:Create('TextLabel', {
  635.                     Name = name;
  636.                     TextStrokeTransparency = library.options.textstroke;
  637.                     TextStrokeColor3 = library.options.strokecolor;
  638.                     Text = "\r" .. name;
  639.                     BackgroundTransparency = 1;
  640.                     TextColor3 = library.options.textcolor;
  641.                     Position = UDim2.new(0, 5, 0, 2);
  642.                     Size     = UDim2.new(1, -5, 1, 0);
  643.                     TextXAlignment = Enum.TextXAlignment.Left;
  644.                     Font = library.options.font;
  645.                     TextSize = library.options.fontsize;
  646.                     library:Create('Frame', {
  647.                         Name = 'Container';
  648.                         Size = UDim2.new(0, 60, 0, 20);
  649.                         Position = UDim2.new(1, -65, 0, 3);
  650.                         BackgroundTransparency = 1;
  651.                         BorderColor3 = library.options.bordercolor;
  652.                         BorderSizePixel = 0;
  653.                         library:Create('TextBox', {
  654.                             Name = 'ValueLabel';
  655.                             Text = default;
  656.                             BackgroundTransparency = 1;
  657.                             TextColor3 = library.options.textcolor;
  658.                             Position = UDim2.new(0, -35, 0, 0);
  659.                             Size     = UDim2.new(0,30,0,20);
  660.                             TextXAlignment = Enum.TextXAlignment.Right;
  661.                             Font = library.options.font;
  662.                             TextSize = library.options.fontsize;
  663.                             TextStrokeTransparency = library.options.textstroke;
  664.                             TextStrokeColor3 = library.options.strokecolor;
  665.                             BackgroundColor3 = library.options.boxcolor;
  666.                             BorderColor3 = library.options.bordercolor;
  667.                             PlaceholderColor3 = library.options.placeholdercolor;
  668.                         });
  669.                         library:Create('TextButton', {
  670.                             Name = 'Button';
  671.                             Size = UDim2.new(0, 5, 1, -2);
  672.                             Position = UDim2.new(0, 0, 0, 1);
  673.                             AutoButtonColor = false;
  674.                             Text = "";
  675.                             BackgroundColor3 = Color3.fromRGB(20, 20, 20);
  676.                             BorderSizePixel = 0;
  677.                             ZIndex = 2;
  678.                             TextStrokeTransparency = library.options.textstroke;
  679.                             TextStrokeColor3 = library.options.strokecolor;
  680.                         });
  681.                         library:Create('Frame', {
  682.                             Name = 'Line';
  683.                             BackgroundTransparency = 0;
  684.                             Position = UDim2.new(0, 0, 0.5, 0);
  685.                             Size     = UDim2.new(1, 0, 0, 1);
  686.                             BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  687.                             BorderSizePixel = 0;
  688.                         });
  689.                     })
  690.                 });
  691.                 Parent = self.container;
  692.             });
  693.  
  694.             local overlay = check:FindFirstChild(name);
  695.  
  696.             local box = overlay:FindFirstChild('Container'):FindFirstChild('ValueLabel');
  697.             box.Focused:connect(function()
  698.                 box.BackgroundTransparency = 0
  699.             end)
  700.             box.FocusLost:connect(function(e)
  701.                 local old = location[flag];
  702.                 local num = tonumber(box.Text)
  703.                 box.BackgroundTransparency = 1
  704.                 if (not num) then
  705.                     box.Text = tonumber(location[flag])
  706.                 else
  707.                     if num < min then
  708.                         num = min
  709.                     elseif num > max then
  710.                         num = max
  711.                     end
  712.  
  713.                     local percent = 1 - ((max - num) / (max - min))
  714.                     local number  = num
  715.  
  716.                     number = tonumber(string.format("%.2f", number))
  717.                     if (not precise) then
  718.                         number = math.floor(number)
  719.                     end
  720.  
  721.                     overlay.Container.Button.Position  = UDim2.new(math.clamp(percent, 0, 0.99), 0,  0, 1)
  722.                     box.Text  = number
  723.                     location[flag] = number
  724.                     callback(number)
  725.                 end
  726.             end)
  727.            
  728.             box:GetPropertyChangedSignal('Text'):connect(function()
  729.                 box.Text = string.gsub(box.Text, "[%a+]", "");
  730.             end)
  731.  
  732.             local renderSteppedConnection;
  733.             local inputBeganConnection;
  734.             local inputEndedConnection;
  735.             local mouseLeaveConnection;
  736.             local mouseDownConnection;
  737.             local mouseUpConnection;
  738.  
  739.             check:FindFirstChild(name).Container.MouseEnter:connect(function()
  740.                 local function update()
  741.                     if renderSteppedConnection then renderSteppedConnection:disconnect() end
  742.                    
  743.  
  744.                     renderSteppedConnection = game:GetService('RunService').RenderStepped:connect(function()
  745.                         local mouse = game:GetService("UserInputService"):GetMouseLocation()
  746.                         local percent = (mouse.X - overlay.Container.AbsolutePosition.X) / (overlay.Container.AbsoluteSize.X)
  747.                         percent = math.clamp(percent, 0, 1)
  748.                         percent = tonumber(string.format("%.2f", percent))
  749.  
  750.                         overlay.Container.Button.Position = UDim2.new(math.clamp(percent, 0, 0.99), 0, 0, 1)
  751.                        
  752.                         local num = min + math.floor((max - min) * percent * 100)/100
  753.                         local value = (precise and num or math.floor(num))
  754.  
  755.                         box.Text = value;
  756.                         callback(tonumber(value))
  757.                         location[flag] = tonumber(value)
  758.                     end)
  759.                 end
  760.  
  761.                 local function disconnect()
  762.                     if renderSteppedConnection then renderSteppedConnection:disconnect() end
  763.                     if inputBeganConnection then inputBeganConnection:disconnect() end
  764.                     if inputEndedConnection then inputEndedConnection:disconnect() end
  765.                     if mouseLeaveConnection then mouseLeaveConnection:disconnect() end
  766.                     if mouseUpConnection then mouseUpConnection:disconnect() end
  767.                 end
  768.  
  769.                 inputBeganConnection = check:FindFirstChild(name).Container.InputBegan:connect(function(input)
  770.                     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  771.                         update()
  772.                     end
  773.                 end)
  774.  
  775.                 inputEndedConnection = check:FindFirstChild(name).Container.InputEnded:connect(function(input)
  776.                     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  777.                         disconnect()
  778.                     end
  779.                 end)
  780.  
  781.                 mouseDownConnection = check:FindFirstChild(name).Container.Button.MouseButton1Down:connect(update)
  782.                 mouseUpConnection   = game:GetService("UserInputService").InputEnded:connect(function(a, b)
  783.                     if a.UserInputType == Enum.UserInputType.MouseButton1 and (mouseDownConnection.Connected) then
  784.                         disconnect()
  785.                     end
  786.                 end)
  787.             end)    
  788.  
  789.             if default ~= min then
  790.                 if default < min then
  791.                     default = min
  792.                 elseif default > max then
  793.                     default = max
  794.                 end
  795.  
  796.                 local percent = 1 - ((max - default) / (max - min))
  797.                 local number  = default
  798.  
  799.                 number = tonumber(string.format("%.2f", number))
  800.                 if (not precise) then
  801.                     number = math.floor(number)
  802.                 end
  803.  
  804.                 overlay.Container.Button.Position  = UDim2.new(math.clamp(percent, 0, 0.99), 0,  0, 1)
  805.                 box.Text  = number
  806.             end
  807.  
  808.             self:Resize();
  809.             return {
  810.                 Set = function(value)
  811.                     if value < min then
  812.                         value = min
  813.                     elseif value > max then
  814.                         value = max
  815.                     end
  816.  
  817.                     local percent = 1 - ((max - value) / (max - min))
  818.                     local number  = value
  819.  
  820.                     number = tonumber(string.format("%.2f", number))
  821.                     if (not precise) then
  822.                         number = math.floor(number)
  823.                     end
  824.  
  825.                     overlay.Container.Button.Position  = UDim2.new(math.clamp(percent, 0, 0.99), 0,  0, 1)
  826.                     box.Text  = number
  827.                     location[flag] = number
  828.                     callback(number)
  829.                 end
  830.             }
  831.         end
  832.  
  833.         function types:SearchBox(text, options, callback)
  834.             options = options or {}
  835.             local list = options.list or {};
  836.             local flag = options.flag or "";
  837.             local location = options.location or self.flags;
  838.             local callback = callback or function() end;
  839.  
  840.             local busy = false;
  841.             local box = library:Create('Frame', {
  842.                 BackgroundTransparency = 1;
  843.                 Size = UDim2.new(1, 0, 0, 25);
  844.                 LayoutOrder = self:GetOrder();
  845.                 library:Create('TextBox', {
  846.                     Text = "";
  847.                     PlaceholderText = text;
  848.                     PlaceholderColor3 = Color3.fromRGB(60, 60, 60);
  849.                     Font = library.options.font;
  850.                     TextSize = library.options.fontsize;
  851.                     Name = 'Box';
  852.                     Size = UDim2.new(1, -10, 0, 20);
  853.                     Position = UDim2.new(0, 5, 0, 4);
  854.                     TextColor3 = library.options.textcolor;
  855.                     BackgroundColor3 = library.options.dropcolor;
  856.                     BorderColor3 = library.options.bordercolor;
  857.                     TextStrokeTransparency = library.options.textstroke;
  858.                     TextStrokeColor3 = library.options.strokecolor;
  859.                     ClipsDescendants = true;
  860.                 });
  861.                 library:Create('ScrollingFrame', { --Move it here so it doesnt conflict with textbox
  862.                     Position = UDim2.new(0, 0, 1, 1);
  863.                     Name = 'Container';
  864.                     BackgroundColor3 = library.options.btncolor;
  865.                     ScrollBarThickness = 0;
  866.                     BorderSizePixel = 0;
  867.                     BorderColor3 = library.options.bordercolor;
  868.                     ScrollingDirection = Enum.ScrollingDirection.Y;
  869.                     Size = UDim2.new(1, 0, 0, 0);
  870.                     library:Create('UIListLayout', {
  871.                         Name = 'ListLayout';
  872.                         SortOrder = Enum.SortOrder.LayoutOrder;
  873.                     });
  874.                     ZIndex = 2;
  875.                 });
  876.                 Parent = self.container;
  877.             })
  878.  
  879.             local function rebuild(text,skip)
  880.                 box:FindFirstChild('Container').ScrollBarThickness = 0
  881.                 for i, child in next, box:FindFirstChild('Container'):GetChildren() do
  882.                     if (not child:IsA('UIListLayout')) then
  883.                         child:Destroy();
  884.                     end
  885.                 end
  886.  
  887.                 if #text > 0 or skip then
  888.                     for i, v in next, list do
  889.                         if string.sub(string.lower(v), 1, string.len(text)) == string.lower(text) or v:lower():match(text:lower()) then
  890.                             local button = library:Create('TextButton', {
  891.                                 Text = v;
  892.                                 Font = library.options.font;
  893.                                 TextSize = library.options.fontsize;
  894.                                 TextColor3 = library.options.textcolor;
  895.                                 BorderColor3 = library.options.bordercolor;
  896.                                 TextStrokeTransparency = library.options.textstroke;
  897.                                 TextStrokeColor3 = library.options.strokecolor;
  898.                                 Parent = box:FindFirstChild('Container');
  899.                                 Size = UDim2.new(1, 0, 0, 20);
  900.                                 LayoutOrder = i;
  901.                                 BackgroundColor3 = library.options.btncolor;
  902.                                 ZIndex = 2;
  903.                             })
  904.                             if button.TextBounds.X >= button.AbsoluteSize.X then
  905.                                 button.TextScaled = true
  906.                             end
  907.                             button.MouseButton1Down:connect(function()
  908.                                 busy = true;
  909.                                 box:FindFirstChild('Box').Text = button.Text;
  910.  
  911.                                 location[flag] = button.Text;
  912.                                 callback(location[flag])
  913.  
  914.                                 box:FindFirstChild('Container').ScrollBarThickness = 0
  915.                                 for i, child in next, box:FindFirstChild('Container'):GetChildren() do
  916.                                     if (not child:IsA('UIListLayout')) then
  917.                                         child:Destroy();
  918.                                     end
  919.                                 end
  920.                                 box:FindFirstChild('Container'):TweenSize(UDim2.new(1, 0, 0, 0), 'Out', 'Quad', 0.25, true)
  921.                             end)
  922.                         end
  923.                     end
  924.                 end
  925.  
  926.                 local c = box:FindFirstChild('Container'):GetChildren()
  927.                 local ry = (20 * (#c)) - 20
  928.  
  929.                 local y = math.clamp((20 * (#c)) - 20, 0, 100)
  930.                 if ry > 100 then
  931.                     box:FindFirstChild('Container').ScrollBarThickness = 5;
  932.                 end
  933.  
  934.                 box:FindFirstChild('Container'):TweenSize(UDim2.new(1, 0, 0, y), 'Out', 'Quad', 0.25, true)
  935.                 box:FindFirstChild('Container').CanvasSize = UDim2.new(1, 0, 0, (20 * (#c)) - 20)
  936.             end
  937.  
  938.             local check = box:FindFirstChild('Box');
  939.             check.Focused:connect(function()
  940.                 rebuild(box:FindFirstChild('Box').Text,true)
  941.                 if box:FindFirstChild('Box').TextBounds.X >= box:FindFirstChild('Box').AbsoluteSize.X then
  942.                     box:FindFirstChild('Box').TextXAlignment = Enum.TextXAlignment.Right
  943.                 else
  944.                     box:FindFirstChild('Box').TextXAlignment = Enum.TextXAlignment.Center
  945.                 end
  946.             end)
  947.             check.FocusLost:connect(function(enterboolean)
  948.                 task.wait(.12)
  949.                 if busy then
  950.                     busy = false;
  951.                     return;
  952.                 end
  953.                 if check.Text == "" then
  954.                     location[flag] = tostring(check.Text);
  955.                     callback(location[flag])
  956.                 elseif enterboolean and box:FindFirstChild('Container'):GetChildren()[2] then
  957.                     check.Text = box:FindFirstChild('Container'):GetChildren()[2].Text;
  958.                     location[flag] =box:FindFirstChild('Container'):GetChildren()[2].Text;
  959.                     callback(location[flag])
  960.                 end
  961.  
  962.                 box:FindFirstChild('Container').ScrollBarThickness = 0
  963.                 for i, child in next, box:FindFirstChild('Container'):GetChildren() do
  964.                     if (not child:IsA('UIListLayout')) then
  965.                         child:Destroy();
  966.                     end
  967.                 end
  968.                 box:FindFirstChild('Container'):TweenSize(UDim2.new(1, 0, 0, 0), 'Out', 'Quad', 0.25, true)
  969.             end);
  970.  
  971.             box:FindFirstChild('Box'):GetPropertyChangedSignal('Text'):connect(function()
  972.                 if (not busy) then
  973.                     rebuild(box:FindFirstChild('Box').Text)
  974.                 end
  975.                 if box:FindFirstChild('Box').TextBounds.X >= box:FindFirstChild('Box').AbsoluteSize.X then
  976.                     box:FindFirstChild('Box').TextXAlignment = Enum.TextXAlignment.Right
  977.                 else
  978.                     box:FindFirstChild('Box').TextXAlignment = Enum.TextXAlignment.Center
  979.                 end
  980.             end);
  981.  
  982.             local function refresh(new_list)
  983.                 list = new_list;
  984.             end
  985.             local function reload(new_list)
  986.                 list = new_list;
  987.                 rebuild("")
  988.             end
  989.             self:Resize();
  990.             return {
  991.                 ['Reload'] = reload;
  992.                 ['Refresh'] = refresh;
  993.                 ['Box'] = box:FindFirstChild('Box');
  994.             }
  995.         end
  996.        
  997.        
  998.         function types:Dropdown(name, options, callback)
  999.             options = options or {}
  1000.             local location = options.location or self.flags;
  1001.             local flag = options.flag or "";
  1002.             local callback = callback or function() end;
  1003.             local list = options.list or {};
  1004.             local default = options.default or list[1]
  1005.             local colors = options.colors or {}
  1006.  
  1007.             location[flag] = default or list[1]
  1008.             local check = library:Create('Frame', {
  1009.                 BackgroundTransparency = 1;
  1010.                 Size = UDim2.new(1, 0, 0, 25);
  1011.                 BackgroundColor3 = Color3.fromRGB(25, 25, 25);
  1012.                 BorderSizePixel = 0;
  1013.                 LayoutOrder = self:GetOrder();
  1014.                 library:Create('Frame', {
  1015.                     Name = 'dropdown_lbl';
  1016.                     BackgroundTransparency = 0;
  1017.                     BackgroundColor3 = library.options.dropcolor;
  1018.                     Position = UDim2.new(0, 5, 0, 4);
  1019.                     BorderColor3 = library.options.bordercolor;
  1020.                     Size     = UDim2.new(1, -10, 0, 20);
  1021.                     library:Create('TextLabel', {
  1022.                         Name = 'Selection';
  1023.                         Size = UDim2.new(1, 0, 1, 0);
  1024.                         Text = location[flag];
  1025.                         TextColor3 = colors[v] or library.options.textcolor;
  1026.                         BackgroundTransparency = 1;
  1027.                         Font = library.options.font;
  1028.                         TextSize = library.options.fontsize;
  1029.                         TextStrokeTransparency = library.options.textstroke;
  1030.                         TextStrokeColor3 = library.options.strokecolor;
  1031.                     });
  1032.                     library:Create("TextButton", {
  1033.                         Name = 'drop';
  1034.                         BackgroundTransparency = 1;
  1035.                         Size = UDim2.new(0, 20, 1, 0);
  1036.                         Position = UDim2.new(1, -25, 0, 0);
  1037.                         Text = 'v';
  1038.                         TextColor3 = library.options.textcolor;
  1039.                         Font = library.options.font;
  1040.                         TextSize = library.options.fontsize;
  1041.                         TextStrokeTransparency = library.options.textstroke;
  1042.                         TextStrokeColor3 = library.options.strokecolor;
  1043.                     })
  1044.                 });
  1045.                 Parent = self.container;
  1046.             });
  1047.            
  1048.             local button = check:FindFirstChild('dropdown_lbl').drop;
  1049.             local input;
  1050.            
  1051.             button.MouseButton1Click:connect(function()
  1052.                 if (input and input.Connected) then
  1053.                     return
  1054.                 end
  1055.                
  1056.                 check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = Color3.fromRGB(60, 60, 60);
  1057.                 check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').Text = name;
  1058.                 local c = 0;
  1059.                 for i, v in next, list do
  1060.                     c = c + 20;
  1061.                 end
  1062.  
  1063.                 local size = UDim2.new(1, 0, 0, c)
  1064.  
  1065.                 local clampedSize;
  1066.                 local scrollSize = 0;
  1067.                 if size.Y.Offset > 100 then
  1068.                     clampedSize = UDim2.new(1, 0, 0, 100)
  1069.                     scrollSize = 5;
  1070.                 end
  1071.                
  1072.                 local goSize = (clampedSize ~= nil and clampedSize) or size;    
  1073.                 local container = library:Create('ScrollingFrame', {
  1074.                     TopImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png';
  1075.                     BottomImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png';
  1076.                     Name = 'DropContainer';
  1077.                     Parent = check:FindFirstChild('dropdown_lbl');
  1078.                     Size = UDim2.new(1, 0, 0, 0);
  1079.                     BackgroundColor3 = library.options.bgcolor;
  1080.                     BorderColor3 = library.options.bordercolor;
  1081.                     Position = UDim2.new(0, 0, 1, 0);
  1082.                     ScrollBarThickness = scrollSize;
  1083.                     CanvasSize = UDim2.new(0, 0, 0, size.Y.Offset);
  1084.                     ZIndex = 5;
  1085.                     ClipsDescendants = true;
  1086.                     library:Create('UIListLayout', {
  1087.                         Name = 'List';
  1088.                         SortOrder = Enum.SortOrder.LayoutOrder
  1089.                     })
  1090.                 })
  1091.  
  1092.                 for i, v in next, list do
  1093.                     local btn = library:Create('TextButton', {
  1094.                         Size = UDim2.new(1, 0, 0, 20);
  1095.                         BackgroundColor3 = library.options.btncolor;
  1096.                         BorderColor3 = library.options.bordercolor;
  1097.                         Text = v;
  1098.                         Font = library.options.font;
  1099.                         TextSize = library.options.fontsize;
  1100.                         LayoutOrder = i;
  1101.                         Parent = container;
  1102.                         ZIndex = 5;
  1103.                         TextColor3 = colors[v] or library.options.textcolor;
  1104.                         TextStrokeTransparency = library.options.textstroke;
  1105.                         TextStrokeColor3 = library.options.strokecolor;
  1106.                     })
  1107.                    
  1108.                     btn.MouseButton1Click:connect(function()
  1109.                         check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = colors[v] or library.options.textcolor
  1110.                         check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').Text = btn.Text;
  1111.  
  1112.                         location[flag] = tostring(btn.Text);
  1113.                         callback(location[flag])
  1114.  
  1115.                         game:GetService('Debris'):AddItem(container, 0)
  1116.                         input:disconnect();
  1117.                     end)
  1118.                 end
  1119.                
  1120.                 container:TweenSize(goSize, 'Out', 'Quad', 0.15, true)
  1121.                
  1122.                 local function isInGui(frame)
  1123.                     local mloc = game:GetService('UserInputService'):GetMouseLocation();
  1124.                     local mouse = Vector2.new(mloc.X, mloc.Y - 36);
  1125.                    
  1126.                     local x1, x2 = frame.AbsolutePosition.X, frame.AbsolutePosition.X + frame.AbsoluteSize.X;
  1127.                     local y1, y2 = frame.AbsolutePosition.Y, frame.AbsolutePosition.Y + frame.AbsoluteSize.Y;
  1128.                
  1129.                     return (mouse.X >= x1 and mouse.X <= x2) and (mouse.Y >= y1 and mouse.Y <= y2)
  1130.                 end
  1131.                
  1132.                 input = game:GetService('UserInputService').InputBegan:connect(function(a)
  1133.                     if a.UserInputType == Enum.UserInputType.MouseButton1 and (not isInGui(container)) then
  1134.                         check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = colors[v] or library.options.textcolor
  1135.                         check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').Text       = location[flag];
  1136.  
  1137.                         container:TweenSize(UDim2.new(1, 0, 0, 0), 'In', 'Quad', 0.15, true)
  1138.                         wait(0.15)
  1139.  
  1140.                         game:GetService('Debris'):AddItem(container, 0)
  1141.                         input:disconnect();
  1142.                     end
  1143.                 end)
  1144.             end)
  1145.            
  1146.             self:Resize();
  1147.             local function reload(array,default)
  1148.                 list = array;
  1149.                 location[flag] = default or array[1];
  1150.                 pcall(function()
  1151.                     input:disconnect()
  1152.                 end)
  1153.                 check:WaitForChild('dropdown_lbl').Selection.Text = location[flag]
  1154.                 check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = colors[v] or library.options.textcolor
  1155.                 game:GetService('Debris'):AddItem(container, 0)
  1156.             end
  1157.  
  1158.             return {
  1159.                 Refresh = reload;
  1160.             }
  1161.         end
  1162.         function types:DropSection(name)
  1163.             local check = library:Create('Frame', {
  1164.                 Name = 'DropSection';
  1165.                 BackgroundTransparency = 1;
  1166.                 Size = UDim2.new(1,0,0,25);
  1167.                 BackgroundColor3 = library.options.sectncolor;
  1168.                 BorderSizePixel = 0;
  1169.                 LayoutOrder = self:GetOrder();
  1170.        
  1171.                 library:Create('Frame',{
  1172.                     Name = 'SectionFrame';
  1173.                     BackgroundTransparency = 1;
  1174.                     Position = UDim2.new(0, 5, 0, 4);
  1175.                     Size = UDim2.new(1, -10, 0, 20);
  1176.                     BackgroundColor3 = library.options.sectncolor;
  1177.                     BorderSizePixel = 0;
  1178.  
  1179.                     library:Create('TextLabel', {
  1180.                         Name = 'section_lbl';
  1181.                         Text = name;
  1182.                         BackgroundTransparency = 0;
  1183.                         BorderSizePixel = 0;
  1184.                         BackgroundColor3 = library.options.sectncolor;
  1185.                         TextColor3 = library.options.textcolor;
  1186.                         Position = UDim2.new();
  1187.                         Size     = UDim2.new(1, 0, 1, 0);
  1188.                         Font = library.options.font;
  1189.                         TextSize = library.options.fontsize;
  1190.                         TextStrokeTransparency = library.options.textstroke;
  1191.                         TextStrokeColor3 = library.options.strokecolor;
  1192.                     });
  1193.                     library:Create("TextButton", {
  1194.                         Name = 'drop';
  1195.                         BackgroundTransparency = 1;
  1196.                         Size = UDim2.new(1, -5, 1, 0);
  1197.                         Position = UDim2.new();
  1198.                         Text = "-";
  1199.                         TextColor3 = library.options.textcolor;
  1200.                         Font = library.options.font;
  1201.                         TextSize = library.options.fontsize;
  1202.                         TextXAlignment = Enum.TextXAlignment.Right;
  1203.                         TextStrokeTransparency = library.options.textstroke;
  1204.                         TextStrokeColor3 = library.options.strokecolor;
  1205.                     });
  1206.                 });
  1207.                 Parent = self.container;
  1208.             });
  1209.             local Container = library:Create('Frame',{
  1210.                 Name = 'Container';
  1211.                 BackgroundTransparency = 0;
  1212.                 Size = UDim2.new();
  1213.                 Position = UDim2.new(0,0,0,25);
  1214.                 BackgroundTransparency = 1;
  1215.                 BorderSizePixel = 0;
  1216.                 Visible = false;
  1217.                 Parent = check;
  1218.                 library:Create('UIListLayout', {
  1219.                     Name = 'List';
  1220.                     SortOrder = Enum.SortOrder.LayoutOrder;
  1221.                 });
  1222.             });
  1223.            
  1224.             local button = check:FindFirstChild('SectionFrame').drop;
  1225.             local input;
  1226.             local dropped = false
  1227.             local dropping = false
  1228.             local droptypes = types
  1229.             droptypes.__index = droptypes
  1230.             local Dropper = setmetatable({
  1231.                 count = 0;
  1232.                 object = check;
  1233.                 container = Container;
  1234.                 textframe = check.SectionFrame.section_lbl;
  1235.                 toggled = false;
  1236.                 flags   = {};
  1237.        
  1238.             }, droptypes)
  1239.        
  1240.            
  1241.             button.MouseButton1Click:connect(function()
  1242.                 if dropping == false then
  1243.                     dropping = true
  1244.                     local newcheck
  1245.                     local newcon
  1246.                     local newy
  1247.                     if dropped == false then
  1248.                         dropped = true
  1249.                    
  1250.                         local c = 0;
  1251.                         for i, v in next, Container:GetChildren() do
  1252.                             if v:IsA('Frame') then
  1253.                                 c = c + v.Size.Y.Offset;
  1254.                             end
  1255.                         end
  1256.                         c = c +2
  1257.            
  1258.                         local size = UDim2.new(1, 0, 0, c)
  1259.            
  1260.                         local clampedSize;
  1261.                         local scrollSize = 0;
  1262.                        
  1263.                         local goSize = (clampedSize ~= nil and clampedSize) or size;
  1264.                         newcheck = goSize+UDim2.new(0,0,0,25)
  1265.                         newcon = goSize
  1266.            
  1267.            
  1268.                         newy = UDim2.new(1,0,0,(self.container.Size.Y.Offset+newcon.Y.Offset))
  1269.                         self.container:TweenSize(newy,'Out','Quad',0.1,true)
  1270.                         check:TweenSize(newcheck, 'Out', 'Quad', 0.15, true)
  1271.                         Container:TweenSize(goSize, 'Out', 'Quad', 0.15, true)
  1272.                        
  1273.                         button.Text = "+"
  1274.                         Container.Visible = true
  1275.                         Container.ClipsDescendants = false
  1276.                     elseif dropped == true then
  1277.                         dropped = false
  1278.                         local c = 0;
  1279.            
  1280.                         local size = UDim2.new(1, 0, 0, c)
  1281.            
  1282.                         local clampedSize;
  1283.                         local scrollSize = 0;
  1284.                        
  1285.                         local goSize = (clampedSize ~= nil and clampedSize) or size;
  1286.                         newcheck = UDim2.new(1,0,0,25)
  1287.                         newcon = goSize
  1288.                         newy = UDim2.new(1,0,0,(self.container.Size.Y.Offset-Container.Size.Y.Offset))
  1289.                         Container.ClipsDescendants = true
  1290.                        
  1291.                         Container:TweenSize(goSize, 'Out', 'Quad', 0.13, true)
  1292.                         check:TweenSize(newcheck, 'Out', 'Quad', 0.14, true)
  1293.                         self.container:TweenSize(newy,'Out','Quad',0.15,true)
  1294.                        
  1295.                        
  1296.                         button.Text = "-"
  1297.                         Container.Visible = false
  1298.                     end
  1299.                     repeat wait() until check.Size == newcheck and Container.Size == newcon
  1300.                     dropping = false
  1301.                 end
  1302.             end)
  1303.             self:Resize();
  1304.             function Dropper:SetText(text)
  1305.                 self.textframe.Text = (type(text) == "string" and text) or "";
  1306.             end
  1307.             return Dropper
  1308.         end
  1309.     end
  1310.    
  1311.     function library:Create(class, data)
  1312.         local obj = Instance.new(class);
  1313.         for i, v in next, data do
  1314.             if i ~= 'Parent' then
  1315.                
  1316.                 if typeof(v) == "Instance" then
  1317.                     v.Parent = obj;
  1318.                 else
  1319.                     obj[i] = v
  1320.                 end
  1321.             end
  1322.         end
  1323.        
  1324.         obj.Parent = data.Parent;
  1325.         return obj
  1326.     end
  1327.    
  1328.     function library:CreateWindow(name, options)
  1329.         if (not library.container) then
  1330.             library.container = self:Create("ScreenGui", {
  1331.                 self:Create('Frame', {
  1332.                     Name = 'Container';
  1333.                     Size = UDim2.new(1, -30, 1, 0);
  1334.                     Position = UDim2.new(0, 20, 0, 20);
  1335.                     BackgroundTransparency = 1;
  1336.                     Active = false;
  1337.                 });
  1338.                 Parent = game:GetService("CoreGui");
  1339.             }):FindFirstChild('Container');
  1340.         end
  1341.        
  1342.         if (not library.options) then
  1343.             library.options = setmetatable(options or {}, {__index = defaults})
  1344.         end
  1345.        
  1346.         local window = types.window(name, library.options);
  1347.         dragger.new(window.object);
  1348.         return window
  1349.     end
  1350.    
  1351.     default = {
  1352.         topcolor       = Color3.fromRGB(30, 30, 30);
  1353.         titlecolor     = Color3.fromRGB(255, 255, 255);
  1354.        
  1355.        
  1356.         underlinecolor = "rainbow";
  1357.         bgcolor        = Color3.fromRGB(30, 30, 30);    -- Background Color
  1358.         boxcolor       = Color3.fromRGB(30, 30, 30);    -- Box Inner Color
  1359.         btncolor       = Color3.fromRGB(50, 50, 50);    -- Button Color
  1360.         dropcolor      = Color3.fromRGB(30, 30, 30);    -- Dropdown Color
  1361.         sectncolor     = Color3.fromRGB(35, 35, 35);    -- Section / Label Colors
  1362.         bordercolor    = Color3.fromRGB(60, 60, 60);    -- Borders around boxes, toggles, buttons Color
  1363.  
  1364.         font           = Enum.Font.SourceSans;
  1365.         titlefont      = Enum.Font.Code;
  1366.  
  1367.         fontsize       = 17;
  1368.         titlesize      = 18;
  1369.  
  1370.         textstroke     = 1;
  1371.         titlestroke    = 1;
  1372.  
  1373.         strokecolor    = Color3.fromRGB(0, 0, 0);
  1374.  
  1375.         textcolor      = Color3.fromRGB(255, 255, 255);
  1376.         titletextcolor = Color3.fromRGB(255, 255, 255);
  1377.  
  1378.         placeholdercolor = Color3.fromRGB(255, 255, 255);
  1379.         titlestrokecolor = Color3.fromRGB(0, 0, 0);
  1380.  
  1381.         toggledisplay = 'Check';
  1382.     }
  1383.  
  1384.     library.options = setmetatable({}, {__index = default})
  1385.  
  1386.     spawn(function()
  1387.         local props = {
  1388.             ['Frame'] = 'BackgroundColor3';
  1389.             ['TextLabel'] = 'TextColor3';
  1390.             ['TextButton'] = 'TextColor3'; 
  1391.         }
  1392.         while true do
  1393.             for i=0, 1, 1 / 300 do              
  1394.                 for _, obj in next, library.rainbowtable do
  1395.                     obj[props[obj.ClassName]] = Color3.fromHSV(i, 1, 1);
  1396.                 end
  1397.                 wait()
  1398.             end;
  1399.         end
  1400.     end)
  1401.  
  1402.     local function isreallypressed(bind, inp)
  1403.         local key = bind
  1404.         if typeof(key) == "Instance" then
  1405.             if key.UserInputType == Enum.UserInputType.Keyboard and inp.KeyCode == key.KeyCode then
  1406.                 return true;
  1407.             elseif tostring(key.UserInputType):find('MouseButton') and inp.UserInputType == key.UserInputType then
  1408.                 return true
  1409.             end
  1410.         end
  1411.         if tostring(key):find'MouseButton1' then
  1412.             return key == inp.UserInputType
  1413.         else
  1414.             return key == inp.KeyCode
  1415.         end
  1416.     end
  1417.  
  1418.     game:GetService("UserInputService").InputBegan:connect(function(input)
  1419.         if (not library.binding) then
  1420.             for idx, binds in next, library.binds do
  1421.                 local real_binding = binds.location[idx];
  1422.                 if real_binding and isreallypressed(real_binding, input) then
  1423.                     binds.callback()
  1424.                 end
  1425.             end
  1426.         end
  1427.     end)
  1428. end
  1429. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement