Advertisement
joefromsansnite

Untitled

Oct 4th, 2021
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.98 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4.     -- Variables
  5.     local themes = {
  6.         BloodTheme = {
  7.             Text = Color3.fromRGB(255, 255, 255),
  8.             Menu = Color3.fromRGB(10, 10, 10),
  9.             Buttons = Color3.fromRGB(255, 0, 0),
  10.             Background = Color3.fromRGB(20, 20, 20),
  11.             Container = Color3.fromRGB(10, 10, 10),
  12.             ButtonsContainer = Color3.fromRGB(15, 15, 15),
  13.             BackFrame = Color3.fromRGB(5, 5, 5),
  14.             Scrollbar = Color3.fromRGB(0, 0, 0)
  15.         },
  16.         LightTheme = {
  17.             Text = Color3.fromRGB(1, 1, 1),
  18.             Menu = Color3.fromRGB(200, 200, 200),
  19.             Buttons = Color3.fromRGB(175, 175, 175),
  20.             Background = Color3.fromRGB(185, 185, 185),
  21.             Container = Color3.fromRGB(155, 155, 155),
  22.             ButtonsContainer = Color3.fromRGB(155, 155, 155),
  23.             BackFrame = Color3.fromRGB(135, 135, 135),
  24.             Scrollbar = Color3.fromRGB(255, 255, 255),
  25.         }
  26.     }
  27.    
  28.     title = (title == nil) and "Title" or title
  29.  
  30.     local uis = game:GetService("UserInputService")
  31.  
  32.     local player = game.Players.LocalPlayer
  33.     local mouse = player:GetMouse()
  34.    
  35.    
  36.     -- Gui
  37.     local ScreenGui = Instance.new("ScreenGui")
  38.     local Menu = Instance.new("Frame")
  39.     local Background = Instance.new("Frame")
  40.     local SideButtons = Instance.new("ScrollingFrame")
  41.     local Frames = Instance.new("Frame")
  42.     local Exit = Instance.new("TextButton")
  43.     local Title = Instance.new("TextLabel")
  44.     local UIGridLayout = Instance.new("UIGridLayout")
  45.  
  46.     ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  47.     ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  48.  
  49.     Menu.Name = "Menu"
  50.     Menu.Parent = ScreenGui
  51.     Menu.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  52.     Menu.BorderSizePixel = 0
  53.     Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  54.     Menu.Size = UDim2.new(0, 450, 0, 15)
  55.  
  56.     Background.Name = "Background"
  57.     Background.Parent = Menu
  58.     Background.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  59.     Background.BorderSizePixel = 0
  60.     Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  61.     Background.Size = UDim2.new(0, 450, 0, 290)
  62.  
  63.     Frames.Name = "Frames"
  64.     Frames.Parent = Background
  65.     Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  66.     Frames.BackgroundTransparency = 1.000
  67.     Frames.BorderSizePixel = 0
  68.     Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  69.     Frames.Size = UDim2.new(0, 330, 0, 290)
  70.    
  71.     SideButtons.Name = "ButtonsContainer"
  72.     SideButtons.Parent = Background
  73.     SideButtons.Active = true
  74.     SideButtons.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  75.     SideButtons.BorderSizePixel = 0
  76.     SideButtons.Size = UDim2.new(0, 120, 0, 290)
  77.     SideButtons.ScrollBarThickness = 8
  78.     SideButtons.BackgroundTransparency = 0
  79.     SideButtons.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  80.     SideButtons.AutomaticCanvasSize = Enum.AutomaticSize.Y
  81.    
  82.     UIGridLayout.Parent = SideButtons
  83.     UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  84.     UIGridLayout.CellSize = UDim2.new(0, 120, 0, 35)
  85.  
  86.     Exit.Name = "Exit"
  87.     Exit.Parent = Menu
  88.     Exit.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  89.     Exit.BorderSizePixel = 0
  90.     Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  91.     Exit.Size = UDim2.new(0, 15, 0, 15)
  92.     Exit.Font = Enum.Font.Code
  93.     Exit.Text = "X"
  94.     Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  95.     Exit.TextSize = 14.000
  96.  
  97.     Title.Name = "Title"
  98.     Title.Parent = Menu
  99.     Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  100.     Title.BackgroundTransparency = 1.000
  101.     Title.BorderSizePixel = 0
  102.     Title.Size = UDim2.new(0, 435, 0, 15)
  103.     Title.Font = Enum.Font.Code
  104.     Title.Text = title
  105.     Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  106.     Title.TextScaled = true
  107.     Title.TextSize = 14.000
  108.     Title.TextWrapped = true
  109.    
  110.     -- Local functions
  111.  
  112.     local function createContainer()
  113.         local Container = Instance.new("Frame")
  114.         Container.Name = "Container"
  115.         Container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  116.         Container.BorderSizePixel = 0
  117.         Container.Size = UDim2.new(0, 100, 0, 100)
  118.  
  119.         return Container
  120.     end
  121.     local function setDraggable()
  122.         Menu.Active = true
  123.         Menu.Draggable = true
  124.     end
  125.     local function exitButton()
  126.         ScreenGui:Destroy()
  127.     end
  128.     local function hideFrames()
  129.         for i,v in pairs(Frames:GetChildren()) do
  130.             v.Visible = false
  131.         end
  132.     end
  133.     -- Functions
  134.     -- Color
  135.     --[[
  136.         function library:Color(args)
  137.         for i,v in pairs(ScreenGui:GetDescendants()) do
  138.             if v:IsA("TextButton")or v:IsA("TextLabel") then
  139.                 v.TextColor3 = args.Text
  140.             elseif v:IsA("TextBox") then
  141.                 v.TextColor3 = args.Text
  142.                 v.PlaceholderColor3 = args.Text
  143.             end
  144.             if v.Name == "Menu" then
  145.                 v.BackgroundColor3 = args.Menu
  146.             end
  147.             if v:IsA("TextButton") then
  148.                 v.BackgroundColor3 = args.Buttons
  149.             end
  150.             if v.Name == "Background" then
  151.                 v.BackgroundColor3 = args.Background
  152.             end
  153.             if v.Name == "Container" then
  154.                 v.BackgroundColor3 = args.Container
  155.             end
  156.             if v.Name == "ButtonsContainer" then
  157.                 v.BackgroundColor3 = args.ButtonsContainer
  158.             end
  159.             if v:IsA("Frame") and v.Name == "Slider" or v.Name == "Toggle" or v:IsA("TextBox") then
  160.                 v.BackgroundColor3 = args.BackFrame
  161.             end
  162.             if v:IsA("ScrollingFrame") then
  163.                 v.ScrollBarImageColor3 = args.Scrollbar
  164.             end
  165.         end
  166.     end
  167.     ]]
  168.    
  169.      -- SetTheme
  170.     --[[
  171.     function library:SetTheme(theme)
  172.         if themes[theme] then
  173.             library:Color(themes[theme])
  174.         else
  175.             library:Color(themes.LightTheme)
  176.         end
  177.     end
  178.     ]]
  179.     function library:Keybind(key, callback)
  180.         uis.InputBegan:Connect(function(input, gameProcessedEvent)
  181.             if gameProcessedEvent then
  182.                 return
  183.             end
  184.             if input.KeyCode == Enum.KeyCode[key] then
  185.                 callback()
  186.             end
  187.         end)
  188.     end
  189.     function library:ToggleVisibility(bool)
  190.         Menu.Visible = bool
  191.     end
  192.    
  193.     local library2 = {}
  194.  
  195.     function library2:NewTab(text)
  196.         text = (text == nil) and "Tab" or text
  197.        
  198.         local TextButton = Instance.new("TextButton")
  199.         local ScrollingFrame = Instance.new("ScrollingFrame")
  200.         local UIGridLayout_2 = Instance.new("UIGridLayout")
  201.  
  202.         TextButton.Parent = SideButtons
  203.         TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  204.         TextButton.BorderSizePixel = 0
  205.         TextButton.Size = UDim2.new(0, 200, 0, 50)
  206.         TextButton.Font = Enum.Font.SourceSans
  207.         TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  208.         TextButton.TextSize = 14.000
  209.         TextButton.Text = text
  210.  
  211.         ScrollingFrame.Parent = Frames
  212.         ScrollingFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  213.         ScrollingFrame.BackgroundTransparency = 1.000
  214.         ScrollingFrame.BorderSizePixel = 0
  215.         ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  216.         ScrollingFrame.ScrollBarThickness = 8
  217.         ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  218.         ScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  219.        
  220.         UIGridLayout_2.Parent = ScrollingFrame
  221.         UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  222.         UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  223.         UIGridLayout_2.CellPadding = UDim2.new(0, 5, 0, 0)
  224.        
  225.         hideFrames()
  226.         ScrollingFrame.Visible = true
  227.        
  228.         TextButton.MouseButton1Down:Connect(function()
  229.             hideFrames()
  230.  
  231.             ScrollingFrame.Visible = true
  232.         end)
  233.  
  234.         local library3 = {}
  235.  
  236.         function library3:NewButton(text, callback)
  237.             text = (text == nil) and "Button" or text
  238.            
  239.             local TextButton = Instance.new("TextButton")
  240.             local Container = createContainer()
  241.  
  242.             Container.Parent = ScrollingFrame
  243.  
  244.             TextButton.Parent = Container
  245.             TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  246.             TextButton.BorderSizePixel = 0
  247.             TextButton.Position = UDim2.new(0.021, 0, 0.12, 0)
  248.             TextButton.Size = UDim2.new(0, 308, 0, 37)
  249.             TextButton.Font = Enum.Font.Code
  250.             TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  251.             TextButton.TextSize = 14.000
  252.             TextButton.Text = text
  253.            
  254.             if type(callback) == "function" then
  255.                 TextButton.MouseButton1Down:Connect(callback)
  256.             end
  257.         end
  258.         function library3:NewTextBox(text, callback)
  259.             text = (text == nil) and "Placeholder" or text
  260.            
  261.             local Container = createContainer()
  262.  
  263.             Container.Parent = ScrollingFrame
  264.  
  265.             local TextBox = Instance.new("TextBox")
  266.             TextBox.Parent = Container
  267.             TextBox.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  268.             TextBox.Position = UDim2.new(0.021, 0, 0.12, 0)
  269.             TextBox.Size = UDim2.new(0, 308, 0, 37)
  270.             TextBox.BorderSizePixel = 0
  271.             TextBox.Font = Enum.Font.SourceSans
  272.             TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  273.             TextBox.TextSize = 14.000
  274.             TextBox.PlaceholderText = text
  275.             TextBox.Text = text
  276.            
  277.             if type(callback) == "function" then
  278.                 TextBox.FocusLost:Connect(function()
  279.                     callback(TextBox.Text)
  280.                 end)
  281.             end
  282.         end
  283.         function library3:NewSlider(text, min, max, callback)
  284.             text = (text == nil) and "Slider" or text
  285.             min = min == nil and 0 or min
  286.             max = max == nil and 10 or max
  287.            
  288.             local holding = false
  289.             local val = 0
  290.  
  291.             local Slider = Instance.new("Frame")
  292.             local TextButton_2 = Instance.new("TextButton")
  293.             local UICorner = Instance.new("UICorner")
  294.             local TextLabel = Instance.new("TextLabel")
  295.             local TextLabel_2 = Instance.new("TextLabel")
  296.             local UICorner_2 = Instance.new("UICorner")
  297.             local Container = createContainer()
  298.  
  299.             Container.Parent = ScrollingFrame
  300.            
  301.             Slider.Name = "Slider"
  302.             Slider.Parent = Container
  303.             Slider.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  304.             Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  305.             Slider.Size = UDim2.new(0, 228, 0, 12)
  306.  
  307.             TextButton_2.Parent = Slider
  308.             TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  309.             TextButton_2.BorderSizePixel = 0
  310.             TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  311.             TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  312.             TextButton_2.Font = Enum.Font.Code
  313.             TextButton_2.Text = ""
  314.             TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  315.             TextButton_2.TextSize = 14.000
  316.  
  317.             UICorner.CornerRadius = UDim.new(8, 0)
  318.             UICorner.Parent = TextButton_2
  319.  
  320.             TextLabel.Parent = Slider
  321.             TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  322.             TextLabel.BackgroundTransparency = 1.000
  323.             TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  324.             TextLabel.Size = UDim2.new(0, 200, 0, 19)
  325.             TextLabel.Font = Enum.Font.Code
  326.             TextLabel.Text = text
  327.             TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  328.             TextLabel.TextSize = 14.000
  329.  
  330.             TextLabel_2.Parent = Slider
  331.             TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  332.             TextLabel_2.BackgroundTransparency = 1.000
  333.             TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  334.             TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  335.             TextLabel_2.Font = Enum.Font.Code
  336.             TextLabel_2.Text = "0"
  337.             TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  338.             TextLabel_2.TextSize = 14.000
  339.  
  340.             UICorner_2.CornerRadius = UDim.new(16, 0)
  341.             UICorner_2.Parent = Slider
  342.  
  343.             TextButton_2.MouseButton1Down:Connect(function()
  344.                 holding = true
  345.                 while holding do
  346.                     local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  347.                     local clampedX = math.clamp(xLocation, 0, 1)
  348.  
  349.                     val = math.ceil( min + (clampedX * (max-min))  )
  350.  
  351.                     TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  352.                     TextLabel_2.Text = tostring(val)
  353.  
  354.                     if type(callback) == "function" then
  355.                         callback(val)
  356.                     end
  357.                     wait()
  358.                 end
  359.             end)
  360.             TextButton_2.MouseButton1Up:Connect(function()
  361.                 holding = false
  362.             end)
  363.             mouse.Button1Up:Connect(function()
  364.                 holding = false
  365.             end)
  366.         end
  367.         function library3:NewToggle(text, callback)
  368.             text = (text == nil) and "Toggle" or text
  369.            
  370.             local toggled = false
  371.             local debounce = false
  372.            
  373.             local Frame = Instance.new("Frame")
  374.             local UICorner = Instance.new("UICorner")
  375.             local TextLabel = Instance.new("TextLabel")
  376.             local TextButton_2 = Instance.new("TextButton")
  377.             local UICorner_2 = Instance.new("UICorner")
  378.             local Container = createContainer()
  379.  
  380.             Container.Parent = ScrollingFrame
  381.  
  382.             Frame.Parent = Container
  383.             Frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  384.             Frame.Position = UDim2.new(0.399999976, 0, 0.439999998, 0)
  385.             Frame.Size = UDim2.new(0, 50, 0, 20)
  386.             Frame.Name = "Toggle"
  387.            
  388.             UICorner.CornerRadius = UDim.new(16, 0)
  389.             UICorner.Parent = Frame
  390.  
  391.             TextLabel.Parent = Frame
  392.             TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  393.             TextLabel.BackgroundTransparency = 1.000
  394.             TextLabel.Position = UDim2.new(-1.51859653, 0, -1.10000002, 0)
  395.             TextLabel.Size = UDim2.new(0, 200, 0, 19)
  396.             TextLabel.Font = Enum.Font.Code
  397.             TextLabel.Text = text
  398.             TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  399.             TextLabel.TextSize = 14.000
  400.  
  401.             TextButton_2.Parent = Frame
  402.             TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  403.             TextButton_2.Position = UDim2.new(0, 0, 2.98023224e-08, 0)
  404.             TextButton_2.Size = UDim2.new(0, 20, 0, 20)
  405.             TextButton_2.Font = Enum.Font.SourceSans
  406.             TextButton_2.Text = ""
  407.             TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  408.             TextButton_2.TextSize = 14.000
  409.             TextButton_2.Name = "ToggleButton"
  410.            
  411.             UICorner_2.CornerRadius = UDim.new(16, 0)
  412.             UICorner_2.Parent = TextButton_2
  413.            
  414.             TextButton_2.MouseButton1Down:Connect(function()
  415.                 if debounce == false then
  416.                     debounce = true
  417.                    
  418.                     toggled = not toggled
  419.  
  420.                     local color = toggled == true and Color3.fromRGB(255, 255, 0) or Color3.fromRGB(255, 0, 0)
  421.                     local position = toggled == true and UDim2.new(0.6, 0, 0, 0) or UDim2.new(0, 0, 0, 0)
  422.  
  423.                     TextButton_2:TweenPosition(position)
  424.                     TextButton_2.BackgroundColor3 = color
  425.  
  426.                     if type(callback) == "function" then
  427.                         callback(toggled)
  428.                     end
  429.                    
  430.                     task.wait(1)
  431.                     debounce = false
  432.                 end
  433.             end)
  434.         end
  435.        
  436.         return library3
  437.     end
  438.    
  439.    
  440.     -- Call functions
  441.     setDraggable()
  442.     Exit.MouseButton1Click:Connect(exitButton)
  443.  
  444.     return library2
  445. end
  446.  
  447. return library
  448.  
  449. -- library:NewWindow(string: title):NewTab(string: text):NewButton(string: text, funciton: callback)
  450. --         Color(dictionary: color)                      NewSlider(string: text, number: min, number: max, function: callback)
  451. --         Keybind(string: key)                          NewTextBox(string: placeholderText, function: callback)
  452. --         SetTheme(string: theme)                       NewToggle(string: text, function: callback)
  453. --         ToggleVisibility(boolean: visible)
  454.  
  455.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement