Absolutionism

[NEW] Wally GUI Library V2 Remastered

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