joefromsansnite

Untitled

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