Advertisement
joefromsansnite

Untitled

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