Advertisement
joefromsansnite

Untitled

Oct 6th, 2021
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.58 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4.     -- Variables
  5.     title = (title == nil) and "Title" or title
  6.    
  7.     local uis = game:GetService("UserInputService")
  8.     local tweenService = game:GetService("TweenService")
  9.    
  10.     local player = game.Players.LocalPlayer
  11.     local mouse = player:GetMouse()
  12.    
  13.    
  14.     -- Gui
  15.     local ScreenGui = Instance.new("ScreenGui")
  16.     local Menu = Instance.new("Frame")
  17.     local Background = Instance.new("Frame")
  18.     local SideContainer = Instance.new("ScrollingFrame")
  19.     local UIListLayout = Instance.new("UIListLayout")
  20.     local Frames = Instance.new("Frame")
  21.     local Exit = Instance.new("TextButton")
  22.     local Title = Instance.new("TextLabel")
  23.  
  24.     ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  25.     ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  26.  
  27.     Menu.Name = "Menu"
  28.     Menu.Parent = ScreenGui
  29.     Menu.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  30.     Menu.BorderSizePixel = 0
  31.     Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  32.     Menu.Size = UDim2.new(0, 450, 0, 15)
  33.  
  34.     Background.Name = "Background"
  35.     Background.Parent = Menu
  36.     Background.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  37.     Background.BorderSizePixel = 0
  38.     Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  39.     Background.Size = UDim2.new(0, 450, 0, 290)
  40.  
  41.     SideContainer.Name = "SideContainer"
  42.     SideContainer.Parent = Background
  43.     SideContainer.Active = true
  44.     SideContainer.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  45.     SideContainer.BorderSizePixel = 0
  46.     SideContainer.Size = UDim2.new(0, 120, 0, 290)
  47.     SideContainer.ScrollBarThickness = 8
  48.     SideContainer.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  49.    
  50.     UIListLayout.Parent = SideContainer
  51.     UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  52.     UIListLayout.Padding = UDim.new(0, 5)
  53.  
  54.     Frames.Name = "Frames"
  55.     Frames.Parent = Background
  56.     Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  57.     Frames.BackgroundTransparency = 1.000
  58.     Frames.BorderSizePixel = 0
  59.     Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  60.     Frames.Size = UDim2.new(0, 330, 0, 290)
  61.  
  62.     Exit.Name = "Exit"
  63.     Exit.Parent = Menu
  64.     Exit.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  65.     Exit.BorderSizePixel = 0
  66.     Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  67.     Exit.Size = UDim2.new(0, 15, 0, 15)
  68.     Exit.Font = Enum.Font.Code
  69.     Exit.Text = "X"
  70.     Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  71.     Exit.TextSize = 14.000
  72.     Exit.AutoButtonColor = false
  73.  
  74.     Title.Name = "Title"
  75.     Title.Parent = Menu
  76.     Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77.     Title.BackgroundTransparency = 1.000
  78.     Title.BorderSizePixel = 0
  79.     Title.Size = UDim2.new(0, 435, 0, 15)
  80.     Title.Font = Enum.Font.Code
  81.     Title.Text = title
  82.     Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  83.     Title.TextScaled = true
  84.     Title.TextSize = 14.000
  85.     Title.TextWrapped = true
  86.    
  87.     -- Local functions
  88.     local function setDraggable()
  89.         Menu.Active = true
  90.         Menu.Draggable = true
  91.     end
  92.     local function exitButton()
  93.         ScreenGui:Destroy()
  94.     end
  95.    
  96.     local function createContainer(parent)
  97.         local Container = Instance.new("Frame")
  98.         local UICorner = Instance.new("UICorner")
  99.  
  100.         Container.Parent = parent
  101.         Container.Name = "Container"
  102.         Container.BackgroundTransparency = 0
  103.         Container.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  104.         Container.BorderSizePixel = 0
  105.         Container.Size = UDim2.new(0, 301, 0, 46)
  106.        
  107.         UICorner.Parent = Container
  108.        
  109.         return Container
  110.     end
  111.     local function hideFrames()
  112.         for i,v in pairs(Frames:GetChildren()) do
  113.             v.Visible = false
  114.         end
  115.     end
  116.     local function resetTabColor()
  117.         for i, v in pairs(SideContainer:GetChildren()) do
  118.             if v:IsA("TextButton") then
  119.                 v.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  120.             end
  121.         end
  122.     end
  123.     local function buttonClickEffect(parent)
  124.         parent.ClipsDescendants = true
  125.        
  126.         local mouseLocation = uis:GetMouseLocation()
  127.         local absolutePosition = parent.AbsolutePosition
  128.        
  129.         local effectXPosition = UDim2.new(0, mouseLocation.X-absolutePosition.X, 0, (mouseLocation.Y-absolutePosition.Y)-36)
  130.        
  131.         local ButtonEffect = Instance.new("ImageLabel")
  132.        
  133.         ButtonEffect.Name = "ButtonEffect"
  134.         ButtonEffect.Parent = parent
  135.         ButtonEffect.AnchorPoint = Vector2.new(0.5, 0.5)
  136.         ButtonEffect.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  137.         ButtonEffect.BackgroundTransparency = 1.000
  138.         ButtonEffect.BorderSizePixel = 0
  139.         ButtonEffect.Position = UDim2.new(0, 0, 0, 0)
  140.         ButtonEffect.Size = UDim2.new(0, 25, 0, 25)
  141.         ButtonEffect.Image = "rbxassetid://7658630902"
  142.         ButtonEffect.ImageTransparency = 0.500
  143.         ButtonEffect.Position = effectXPosition
  144.  
  145.         ButtonEffect:TweenSize(UDim2.new(0, 175, 0, 175))
  146.        
  147.         spawn(function()
  148.             for i = 0.5, 1.05, 0.05 do
  149.                 ButtonEffect.ImageTransparency = i
  150.                 if i >= 1 then
  151.                     ButtonEffect:Destroy()
  152.                 end
  153.                 wait()
  154.             end
  155.         end)
  156.     end
  157.     local function dropdownEffect(ui, visible, rot1, rot2)
  158.         local properties = (visible == true) and {
  159.             Rotation = rot1
  160.         } or {
  161.             Rotation = rot2
  162.         }
  163.  
  164.         local info = TweenInfo.new(0.5)
  165.         local tween = tweenService:Create(ui, info, properties)
  166.  
  167.         tween:Play()
  168.     end
  169.    
  170.    
  171.     local library2 = {}
  172.    
  173.     function library2:Keybind(key, callback)
  174.         key = (key == nil) and "E" or key
  175.        
  176.         uis.InputBegan:Connect(function(input, gameProcessedEvent)
  177.             if gameProcessedEvent then
  178.                 return
  179.             end
  180.             if type(callback) == "function" then
  181.                 if type(key) == "string" then
  182.                     if input.KeyCode == Enum.KeyCode[key] then
  183.                         callback()
  184.                     end
  185.                 elseif type(key) == "table" then
  186.                     for i,v in pairs(key) do
  187.                         if input.KeyCode == Enum.KeyCode[v] then
  188.                             callback()
  189.                         end
  190.                     end
  191.                 end
  192.                
  193.             end
  194.         end)
  195.     end
  196.     function library2:ToggleVisibility(bool)
  197.         Menu.Visible = bool
  198.     end
  199.    
  200.     function library2:NewTab(text)
  201.         text = (type(text) ~= "string") and "Tab" or text
  202.        
  203.         local TextButton = Instance.new("TextButton")
  204.         local ScrollingFrame = Instance.new("ScrollingFrame")
  205.         local UIListLayout = Instance.new("UIListLayout")
  206.         local UICorner = Instance.new("UICorner")
  207.  
  208.         TextButton.Parent = SideContainer
  209.         TextButton.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  210.         TextButton.BorderSizePixel = 0
  211.         TextButton.Size = UDim2.new(0, 114, 0, 35)
  212.         TextButton.Font = Enum.Font.SourceSans
  213.         TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  214.         TextButton.TextSize = 14.000
  215.         TextButton.Text = text
  216.         TextButton.AutoButtonColor = false
  217.         TextButton.ClipsDescendants = true
  218.        
  219.         ScrollingFrame.Parent = Frames
  220.         ScrollingFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  221.         ScrollingFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  222.         ScrollingFrame.BackgroundTransparency = 1.000
  223.         ScrollingFrame.BorderSizePixel = 0
  224.         ScrollingFrame.Size = UDim2.new(0, 310, 0, 270)
  225.         ScrollingFrame.Position = UDim2.new(0, 165, 0, 140)
  226.         ScrollingFrame.ScrollBarThickness = 8
  227.         ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  228.         ScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  229.        
  230.         UIListLayout.Parent = ScrollingFrame
  231.         UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  232.         UIListLayout.Padding = UDim.new(0, 10)
  233.        
  234.         UICorner.Parent = TextButton
  235.        
  236.         hideFrames()
  237.         TextButton.MouseButton1Down:Connect(function()
  238.             buttonClickEffect(TextButton)
  239.             hideFrames()
  240.             resetTabColor()
  241.            
  242.             ScrollingFrame.Visible = true
  243.             TextButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  244.         end)
  245.  
  246.         local library3 = {}
  247.        
  248.         function library3:NewSection(text)
  249.             text = (type(text) ~= "string") and "Section" or text
  250.            
  251.             local Section = Instance.new("Frame")
  252.             local UIListLayout = Instance.new("UIListLayout")
  253.             local UICorner = Instance.new("UICorner")
  254.             local SectionText = Instance.new("TextLabel")
  255.             local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
  256.             local SectionDropdown = Instance.new("TextButton")
  257.             local arrow_drop = Instance.new("ImageButton")
  258.  
  259.             Section.Name = "Section"
  260.             Section.Parent = ScrollingFrame
  261.             Section.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  262.             Section.BorderSizePixel = 0
  263.             Section.Size = UDim2.new(0, 305, 0, 50)
  264.             Section.AutomaticSize = Enum.AutomaticSize.Y
  265.  
  266.             UIListLayout.Parent = Section
  267.             UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  268.             UIListLayout.Padding = UDim.new(0, 5)
  269.            
  270.             SectionText.Name = "SectionText"
  271.             SectionText.Parent = Section
  272.             SectionText.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  273.             SectionText.BorderSizePixel = 0
  274.             SectionText.Size = UDim2.new(0, 301, 0, 54)
  275.             SectionText.Font = Enum.Font.Code
  276.             SectionText.Text = text
  277.             SectionText.TextColor3 = Color3.fromRGB(255, 255, 255)
  278.             SectionText.TextSize = 25.000
  279.  
  280.             UIAspectRatioConstraint.Parent = SectionText
  281.             UIAspectRatioConstraint.AspectRatio = 10.000
  282.  
  283.             arrow_drop.Name = "arrow_drop_up"
  284.             arrow_drop.Parent = SectionText
  285.             arrow_drop.AnchorPoint = Vector2.new(0.5, 0.5)
  286.             arrow_drop.BackgroundTransparency = 1.000
  287.             arrow_drop.Position = UDim2.new(0.0333333351, 5, 0.5, 0)
  288.             arrow_drop.Rotation = 180.000
  289.             arrow_drop.Size = UDim2.new(0, 33, 0, 45)
  290.             arrow_drop.Image = "rbxassetid://3926307971"
  291.             arrow_drop.ImageRectOffset = Vector2.new(164, 484)
  292.             arrow_drop.ImageRectSize = Vector2.new(36, 36)
  293.            
  294.             UICorner.Parent = Section
  295.             UICorner.CornerRadius = UDim.new(0, 10)
  296.            
  297.             arrow_drop.MouseButton1Down:Connect(function() 
  298.                 local visible = true
  299.  
  300.                 for i,v in pairs(Section:GetChildren()) do
  301.                     if v:IsA("Frame") then
  302.                         v.Visible = not v.Visible
  303.                         visible = v.Visible
  304.                     end
  305.                 end
  306.                
  307.                 dropdownEffect(arrow_drop, visible, 180, 90)
  308.             end)
  309.            
  310.             local library4 = {}
  311.            
  312.             function library4:NewButton(text, callback)
  313.                 text = (type(text) ~= "string") and "Button" or text
  314.  
  315.                 local TextButton = Instance.new("TextButton")
  316.                 local UICorner = Instance.new("UICorner")
  317.                 local Container = createContainer(Section)
  318.  
  319.                 TextButton.Parent = Container
  320.                 TextButton.AnchorPoint = Vector2.new(0.5, 0.5)
  321.                 TextButton.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  322.                 TextButton.BorderSizePixel = 0
  323.                 TextButton.Position = UDim2.new(0.5, 0, 0.5, 0)
  324.                 TextButton.Size = UDim2.new(0, 291, 0, 37)
  325.                 TextButton.AutoButtonColor = false
  326.                 TextButton.Font = Enum.Font.Code
  327.                 TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  328.                 TextButton.TextSize = 14.000
  329.                 TextButton.Text = text
  330.                 TextButton.ClipsDescendants = true
  331.                
  332.                 UICorner.CornerRadius = UDim.new(0, 8)
  333.                 UICorner.Parent = TextButton
  334.                
  335.                 TextButton.MouseButton1Down:Connect(function()
  336.                     buttonClickEffect(TextButton)
  337.                    
  338.                     if type(callback) == "function" then
  339.                         callback()
  340.                     else
  341.                         print("Clicked!")
  342.                     end
  343.                 end)
  344.             end
  345.             function library4:NewTextBox(text, callback)
  346.                 text = (type(text) ~= "string") and "Placeholder" or text
  347.  
  348.                 local Container = createContainer(Section)
  349.                 local TextBox = Instance.new("TextBox")
  350.                
  351.                 TextBox.Parent = Container
  352.                 TextBox.AnchorPoint = Vector2.new(0.5, 0.5)
  353.                 TextBox.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  354.                 TextBox.Position = UDim2.new(0.5, 0, 0.5, 0)
  355.                 TextBox.Size = UDim2.new(0, 291, 0, 37)
  356.                 TextBox.BorderSizePixel = 0
  357.                 TextBox.Font = Enum.Font.SourceSans
  358.                 TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  359.                 TextBox.TextSize = 14.000
  360.                 TextBox.PlaceholderText = text
  361.                 TextBox.Text = text
  362.                
  363.                 UICorner.CornerRadius = UDim.new(0, 8)
  364.                 UICorner.Parent = TextBox
  365.                
  366.                 TextBox.FocusLost:Connect(function()
  367.                     if type(callback) == "function" then
  368.                         callback(TextBox.Text)
  369.                     else
  370.                         print("Lost Focus")
  371.                     end
  372.                 end)
  373.             end
  374.             function library4:NewSlider(text, min, max, callback)
  375.                 text = (type(text) ~= "string") and "Slider" or text
  376.                 min = min == nil and 0 or min
  377.                 max = max == nil and 10 or max
  378.  
  379.                 local holding = false
  380.                 local val = 0
  381.  
  382.                 local Slider = Instance.new("Frame")
  383.                 local TextButton_2 = Instance.new("TextButton")
  384.                 local UICorner = Instance.new("UICorner")
  385.                 local TextLabel = Instance.new("TextLabel")
  386.                 local TextLabel_2 = Instance.new("TextLabel")
  387.                 local UICorner_2 = Instance.new("UICorner")
  388.                 local Container = createContainer(Section)
  389.                
  390.                 Slider.Name = "Slider"
  391.                 Slider.Parent = Container
  392.                 Slider.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  393.                 Slider.Position = UDim2.new(0.5, 0, 0.5, 0)
  394.                 Slider.Size = UDim2.new(0, 228, 0, 12)
  395.                 Slider.AnchorPoint = Vector2.new(0.5, 0.5)
  396.                
  397.                 TextButton_2.Parent = Slider
  398.                 TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  399.                 TextButton_2.BorderSizePixel = 0
  400.                 TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  401.                 TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  402.                 TextButton_2.Font = Enum.Font.Code
  403.                 TextButton_2.Text = ""
  404.                 TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  405.                 TextButton_2.TextSize = 14.000
  406.  
  407.                 UICorner.CornerRadius = UDim.new(16, 0)
  408.                 UICorner.Parent = TextButton_2
  409.  
  410.                 TextLabel.Parent = Slider
  411.                 TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  412.                 TextLabel.BackgroundTransparency = 1.000
  413.                 TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  414.                 TextLabel.Size = UDim2.new(0, 200, 0, 19)
  415.                 TextLabel.Font = Enum.Font.Code
  416.                 TextLabel.Text = text
  417.                 TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  418.                 TextLabel.TextSize = 14.000
  419.  
  420.                 TextLabel_2.Parent = Slider
  421.                 TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  422.                 TextLabel_2.BackgroundTransparency = 1.000
  423.                 TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  424.                 TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  425.                 TextLabel_2.Font = Enum.Font.Code
  426.                 TextLabel_2.Text = "0"
  427.                 TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  428.                 TextLabel_2.TextSize = 14.000
  429.  
  430.                 UICorner_2.CornerRadius = UDim.new(16, 0)
  431.                 UICorner_2.Parent = Slider
  432.  
  433.                 TextButton_2.MouseButton1Down:Connect(function()
  434.                     holding = true
  435.                     while holding do
  436.                         local mouseLocation = uis:GetMouseLocation()
  437.                         local absolutePosition = Slider.AbsolutePosition
  438.                         local absoluteSize = Slider.AbsoluteSize
  439.                        
  440.                         local xLocation = (mouseLocation.X - absolutePosition.X) / absoluteSize.X
  441.                         local clampedX = math.clamp(xLocation, 0, 1)
  442.  
  443.                         val = math.ceil( min + (clampedX * (max-min))  )
  444.  
  445.                         TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  446.                         TextLabel_2.Text = tostring(val)
  447.  
  448.                         if type(callback) == "function" then
  449.                             callback(val)
  450.                         else
  451.                             print("Slider Value: "..val)
  452.                         end
  453.                         wait()
  454.                     end
  455.                 end)
  456.                
  457.                 TextButton_2.MouseButton1Up:Connect(function()
  458.                     holding = false
  459.                 end)
  460.                 mouse.Button1Up:Connect(function()
  461.                     holding = false
  462.                 end)
  463.             end
  464.             function library4:NewToggle(text, callback)
  465.                 text = (type(text) ~= "string") and "Toggle" or text
  466.  
  467.                 local toggled = false
  468.                 local debounce = false
  469.  
  470.                 local Frame = Instance.new("Frame")
  471.                 local UICorner = Instance.new("UICorner")
  472.                 local TextLabel = Instance.new("TextLabel")
  473.                 local TextButton_2 = Instance.new("TextButton")
  474.                 local UICorner_2 = Instance.new("UICorner")
  475.                 local Container = createContainer(Section)
  476.  
  477.                 Frame.Parent = Container
  478.                 Frame.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  479.                 Frame.Position = UDim2.new(0.5, 0, 0.65, 0)
  480.                 Frame.Size = UDim2.new(0, 50, 0, 20)
  481.                 Frame.Name = "Toggle"
  482.                 Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  483.                
  484.                 UICorner.CornerRadius = UDim.new(16, 0)
  485.                 UICorner.Parent = Frame
  486.  
  487.                 TextLabel.Parent = Frame
  488.                 TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  489.                 TextLabel.BackgroundTransparency = 1.000
  490.                 TextLabel.Position = UDim2.new(-1.51859653, 0, -1.10000002, 0)
  491.                 TextLabel.Size = UDim2.new(0, 200, 0, 19)
  492.                 TextLabel.Font = Enum.Font.Code
  493.                 TextLabel.Text = text
  494.                 TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  495.                 TextLabel.TextSize = 14.000
  496.  
  497.                 TextButton_2.Parent = Frame
  498.                 TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  499.                 TextButton_2.Position = UDim2.new(0, 0, 2.98023224e-08, 0)
  500.                 TextButton_2.Size = UDim2.new(0, 20, 0, 20)
  501.                 TextButton_2.Font = Enum.Font.SourceSans
  502.                 TextButton_2.Text = ""
  503.                 TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  504.                 TextButton_2.TextSize = 14.000
  505.                 TextButton_2.Name = "ToggleButton"
  506.  
  507.                 UICorner_2.CornerRadius = UDim.new(16, 0)
  508.                 UICorner_2.Parent = TextButton_2
  509.  
  510.                 TextButton_2.MouseButton1Down:Connect(function()
  511.                     if debounce == false then
  512.                         debounce = true
  513.  
  514.                         toggled = not toggled
  515.  
  516.                         local color = toggled == true and Color3.fromRGB(255, 255, 0) or Color3.fromRGB(255, 0, 0)
  517.                         local position = toggled == true and UDim2.new(0.6, 0, 0, 0) or UDim2.new(0, 0, 0, 0)
  518.  
  519.                         TextButton_2:TweenPosition(position)
  520.                         TextButton_2.BackgroundColor3 = color
  521.  
  522.                         if type(callback) == "function" then
  523.                             callback(toggled)
  524.                         else
  525.                             print("Toggled: "..tostring(toggled))
  526.                         end
  527.  
  528.                         task.wait(1)
  529.                         debounce = false
  530.                     end
  531.                 end)
  532.             end
  533.            
  534.             function library4:NewDropdown(text, items, callback)
  535.                 text = (type(text) ~= "string") and "Dropdown" or text
  536.                 items = (type(items) ~= "table") and {} or items
  537.                
  538.                 local Dropdown = Instance.new("Frame")
  539.                 local TextLabel = Instance.new("TextLabel")
  540.                 local TextLabel_2 = Instance.new("TextLabel")
  541.                 local arrow_drop = Instance.new("ImageButton")
  542.                 local Items = Instance.new("ScrollingFrame")
  543.                 local UIListLayout = Instance.new("UIListLayout")
  544.                 local UICorner_2 = Instance.new("UICorner")
  545.                 local Container = createContainer(Section)
  546.                                
  547.                 Dropdown.Name = "Dropdown"
  548.                 Dropdown.Parent = Container
  549.                 Dropdown.AnchorPoint = Vector2.new(0.5, 0.675)
  550.                 Dropdown.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  551.                 Dropdown.Position = UDim2.new(0.5, 0, 0.765, 0)
  552.                 Dropdown.Size = UDim2.new(0, 143, 0, 22)
  553.                
  554.                 TextLabel.Parent = Dropdown
  555.                 TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  556.                 TextLabel.BackgroundTransparency = 1.000
  557.                 TextLabel.Size = UDim2.new(0, 125, 0, 22)
  558.                 TextLabel.Font = Enum.Font.Code
  559.                 TextLabel.Text = "Selected: "
  560.                 TextLabel.TextScaled = true
  561.                 TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  562.                 TextLabel.TextSize = 14.000
  563.  
  564.                 TextLabel_2.Parent = Dropdown
  565.                 TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  566.                 TextLabel_2.BackgroundTransparency = 1.000
  567.                 TextLabel_2.Position = UDim2.new(0.0212121084, 0, -0.954545438, 0)
  568.                 TextLabel_2.Size = UDim2.new(0, 135, 0, 13)
  569.                 TextLabel_2.Font = Enum.Font.Code
  570.                 TextLabel_2.Text = text
  571.                 TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  572.                 TextLabel_2.TextSize = 14.000
  573.  
  574.                 arrow_drop.Name = "arrow_drop_down"
  575.                 arrow_drop.Parent = Dropdown
  576.                 arrow_drop.AnchorPoint = Vector2.new(0.5, 0.5)
  577.                 arrow_drop.BackgroundTransparency = 1.000
  578.                 arrow_drop.Position = UDim2.new(0.883020937, 0, 0.463999987, 0)
  579.                 arrow_drop.Size = UDim2.new(0, 22, 0, 22)
  580.                 arrow_drop.ZIndex = 2
  581.                 arrow_drop.Image = "rbxassetid://3926307971"
  582.                 arrow_drop.ImageRectOffset = Vector2.new(324, 524)
  583.                 arrow_drop.ImageRectSize = Vector2.new(36, 36)
  584.  
  585.                 Items.Name = "Items"
  586.                 Items.Parent = Dropdown
  587.                 Items.Active = true
  588.                 Items.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
  589.                 Items.BorderSizePixel = 0
  590.                 Items.Position = UDim2.new(0, 0, 1, 0)
  591.                 Items.Size = UDim2.new(0, 143, 0, 69)
  592.                 Items.Visible = false
  593.                 Items.CanvasSize = UDim2.new(0, 0, 10, 0)
  594.                 Items.AutomaticCanvasSize = Enum.AutomaticSize.Y
  595.                
  596.                 UIListLayout.Parent = Items
  597.  
  598.                 UICorner_2.Parent = Dropdown
  599.                
  600.                 local function setContainerSize()
  601.                     Dropdown.Position = (Items.Visible == true) and UDim2.new(0.5, 0, 0.3, 0) or UDim2.new(0.5, 0, 0.765, 0)
  602.                     Container.Size = (Items.Visible == true) and UDim2.new(0, 301, 0, 114) or UDim2.new(0, 301, 0, 46)
  603.                 end
  604.                
  605.                 arrow_drop.MouseButton1Down:Connect(function()
  606.                     Items.Visible = not Items.Visible
  607.                    
  608.                     setContainerSize()
  609.  
  610.                     dropdownEffect(arrow_drop, Items.Visible, 180, 0)
  611.                 end)
  612.                
  613.                 for _, item in pairs(items) do
  614.                     local name = (typeof(item) == "Instance") and item.Name or item
  615.                    
  616.                     local ItemButton = Instance.new("TextButton")
  617.                     local UICorner = Instance.new("UICorner")
  618.                
  619.                     ItemButton.Name = "ItemButton"
  620.                     ItemButton.Parent = Items
  621.                     ItemButton.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  622.                     ItemButton.Position = UDim2.new(0, 0, 0, 0)
  623.                     ItemButton.Size = UDim2.new(0, 132, 0, 26)
  624.                     ItemButton.AutoButtonColor = false
  625.                     ItemButton.Font = Enum.Font.Code
  626.                     ItemButton.Text = name
  627.                     ItemButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  628.                     ItemButton.TextSize = 14.000
  629.                    
  630.                     UICorner.Parent = ItemButton
  631.                    
  632.                     ItemButton.MouseButton1Down:Connect(function()
  633.                         buttonClickEffect(ItemButton)
  634.                        
  635.                         TextLabel.Text = "Selected: "..name
  636.                         Items.Visible = false
  637.                         dropdownEffect(arrow_drop, Items.Visible, 180, 0)
  638.                         setContainerSize()
  639.                        
  640.                         if type(callback) == "function" then
  641.                             callback(name)
  642.                         end
  643.                     end)
  644.                 end
  645.             end
  646.            
  647.             return library4
  648.         end
  649.         return library3
  650.     end
  651.    
  652.    
  653.     -- Call functions
  654.     setDraggable()
  655.     Exit.MouseButton1Click:Connect(exitButton)
  656.  
  657.     return library2
  658. end
  659.  
  660. return library
  661.  
  662. -- library:NewWindow(string: title):NewTab(string: text): NewSection:(string: title): NewButton(string: text, funciton: callback)
  663. --                                  Color(dictionary: color)                          NewSlider(string: text, number: min, number: max, function: callback)
  664. --                                  Keybind(string: key)                              NewTextBox(string: placeholderText, function: callback)
  665. --                                  SetTheme(string: theme)                           NewToggle(string: text, function: callback)
  666. --                                  ToggleVisibility(boolean: visible)                                       
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement