joefromsansnite

Untitled

Oct 1st, 2021
1,278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.72 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4.     local uis = game:GetService("UserInputService")
  5.    
  6.     local player = game.Players.LocalPlayer
  7.     local mouse = player:GetMouse()
  8.    
  9.     local ScreenGui = Instance.new("ScreenGui")
  10.     local Menu = Instance.new("Frame")
  11.     local Background = Instance.new("Frame")
  12.     local SideButtons = Instance.new("ScrollingFrame")
  13.     local UIGridLayout = Instance.new("UIGridLayout")
  14.     local Frames = Instance.new("Frame")
  15.     local Exit = Instance.new("TextButton")
  16.     local Title = Instance.new("TextLabel")
  17.  
  18.     ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  19.     ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  20.     ScreenGui.ResetOnSpawn = false
  21.    
  22.     Menu.Name = "Menu"
  23.     Menu.Parent = ScreenGui
  24.     Menu.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  25.     Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  26.     Menu.Size = UDim2.new(0, 450, 0, 15)
  27.  
  28.     Background.Name = "Background"
  29.     Background.Parent = Menu
  30.     Background.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  31.     Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  32.     Background.Size = UDim2.new(0, 450, 0, 290)
  33.  
  34.     SideButtons.Name = "SideButtons"
  35.     SideButtons.Parent = Background
  36.     SideButtons.Active = true
  37.     SideButtons.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  38.     SideButtons.Size = UDim2.new(0, 120, 0, 290)
  39.  
  40.     UIGridLayout.Parent = SideButtons
  41.     UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  42.     UIGridLayout.CellSize = UDim2.new(0, 120, 0, 35)
  43.  
  44.     Frames.Name = "Frames"
  45.     Frames.Parent = Background
  46.     Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  47.     Frames.BackgroundTransparency = 1.000
  48.     Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  49.     Frames.Size = UDim2.new(0, 330, 0, 290)
  50.  
  51.     Exit.Name = "Exit"
  52.     Exit.Parent = Menu
  53.     Exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  54.     Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  55.     Exit.Size = UDim2.new(0, 15, 0, 15)
  56.     Exit.Font = Enum.Font.SourceSans
  57.     Exit.Text = "X"
  58.     Exit.TextColor3 = Color3.fromRGB(0, 0, 0)
  59.     Exit.TextSize = 14.000
  60.  
  61.     Title.Name = "Title"
  62.     Title.Parent = Menu
  63.     Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  64.     Title.BackgroundTransparency = 1.000
  65.     Title.Size = UDim2.new(0, 435, 0, 15)
  66.     Title.Font = Enum.Font.SourceSans
  67.     Title.TextColor3 = Color3.fromRGB(0, 0, 0)
  68.     Title.TextSize = 14.000
  69.     Title.Text = title
  70.    
  71.     local library2 = {}
  72.    
  73.     function library2:NewTab(text)
  74.         local TextButton = Instance.new("TextButton")
  75.         TextButton.Parent = SideButtons
  76.         TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77.         TextButton.Size = UDim2.new(0, 200, 0, 50)
  78.         TextButton.Font = Enum.Font.SourceSans
  79.         TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  80.         TextButton.TextSize = 14.000
  81.         TextButton.Text = text
  82.        
  83.         local ScrollingFrame = Instance.new("ScrollingFrame")
  84.         ScrollingFrame.Parent = Frames
  85.         ScrollingFrame.Active = true
  86.         ScrollingFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  87.         ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  88.        
  89.         local UIGridLayout_2 = Instance.new("UIGridLayout")
  90.         UIGridLayout_2.Parent = ScrollingFrame
  91.         UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  92.         UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  93.        
  94.         TextButton.MouseButton1Down:Connect(function()
  95.             for i,v in pairs(Frames:GetChildren()) do
  96.                 v.Visible = false
  97.             end
  98.            
  99.             ScrollingFrame.Visible = true
  100.         end)
  101.        
  102.         local library3 = {}
  103.        
  104.         function library3:NewButton(text, callback)
  105.             local UIHolder = Instance.new("Frame")
  106.  
  107.             UIHolder.Name = "UIHolder"
  108.             UIHolder.Parent = ScrollingFrame
  109.             UIHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  110.             UIHolder.Size = UDim2.new(0, 100, 0, 100)
  111.            
  112.             local TextButton_2 = Instance.new("TextButton")
  113.             TextButton_2.Parent = UIHolder
  114.             TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  115.             TextButton_2.Position = UDim2.new(0.0199999996, 0, 0.100000001, 0)
  116.             TextButton_2.Size = UDim2.new(0, 302, 0, 40)
  117.             TextButton_2.Font = Enum.Font.SourceSans
  118.             TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  119.             TextButton_2.TextSize = 14.000
  120.             TextButton_2.Text = text
  121.            
  122.             if type(callback) == "function" then
  123.                 TextButton_2.MouseButton1Down:Connect(callback)
  124.             end
  125.         end
  126.         function library3:NewTextbox(text, callback)
  127.             local UIHolder = Instance.new("Frame")
  128.  
  129.             UIHolder.Name = "UIHolder"
  130.             UIHolder.Parent = ScrollingFrame
  131.             UIHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  132.             UIHolder.Size = UDim2.new(0, 100, 0, 100)
  133.            
  134.             local TextBox = Instance.new("TextBox")
  135.             TextBox.Parent = UIHolder
  136.             TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  137.             TextBox.Position = UDim2.new(0.0199999996, 0, 0.100000001, 0)
  138.             TextBox.Size = UDim2.new(0, 302, 0, 40)
  139.             TextBox.Font = Enum.Font.SourceSans
  140.             TextBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  141.             TextBox.TextSize = 14.000
  142.             TextBox.Text = text
  143.            
  144.             if type(callback) == "function" then
  145.                 TextBox.FocusLost:Connect(function()
  146.                     callback(TextBox.Text)
  147.                 end)
  148.             end
  149.         end
  150.        
  151.         function library3:NewSlider(text, min, max, callback)
  152.             local holding = false
  153.             local val = 0
  154.            
  155.             local Slider = Instance.new("Frame")
  156.             local TextButton_2 = Instance.new("TextButton")
  157.             local TextLabel = Instance.new("TextLabel")
  158.             local TextLabel_2 = Instance.new("TextLabel")
  159.             local UIHolder = Instance.new("Frame")
  160.  
  161.             UIHolder.Name = "UIHolder"
  162.             UIHolder.Parent = ScrollingFrame
  163.             UIHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  164.             UIHolder.Size = UDim2.new(0, 100, 0, 100)
  165.            
  166.             Slider.Name = "Slider"
  167.             Slider.Parent = UIHolder
  168.             Slider.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  169.             Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  170.             Slider.Size = UDim2.new(0, 228, 0, 12)
  171.  
  172.             TextButton_2.Parent = Slider
  173.             TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  174.             TextButton_2.Position = UDim2.new(0, 0, 0, 0)
  175.             TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  176.             TextButton_2.Font = Enum.Font.SourceSans
  177.             TextButton_2.Text = ""
  178.             TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  179.             TextButton_2.TextSize = 14.000
  180.  
  181.             TextLabel.Parent = Slider
  182.             TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  183.             TextLabel.BackgroundTransparency = 1.000
  184.             TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  185.             TextLabel.Size = UDim2.new(0, 200, 0, 19)
  186.             TextLabel.Font = Enum.Font.SourceSans
  187.             TextLabel.Text = text
  188.             TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  189.             TextLabel.TextSize = 14.000
  190.  
  191.             TextLabel_2.Parent = Slider
  192.             TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  193.             TextLabel_2.BackgroundTransparency = 1.000
  194.             TextLabel_2.Position = UDim2.new(0.05, 0, 1, 0)
  195.             TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  196.             TextLabel_2.Font = Enum.Font.SourceSans
  197.             TextLabel_2.Text = tostring(min)
  198.             TextLabel_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  199.             TextLabel_2.TextSize = 14.000
  200.            
  201.             TextButton_2.MouseButton1Down:Connect(function()
  202.                 holding = true
  203.                 while holding do
  204.                     local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  205.                     local clampedX = math.clamp(xLocation, 0, 1)
  206.                                        
  207.                     val = math.ceil( min + (clampedX * (max-min))  )
  208.                    
  209.                     TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  210.                     TextLabel_2.Text = tostring(val)
  211.                    
  212.                     callback(val)
  213.                     wait()
  214.                 end
  215.             end)
  216.             TextButton_2.MouseButton1Up:Connect(function()
  217.                 holding = false
  218.             end)
  219.             mouse.Button1Up:Connect(function()
  220.                 holding = false
  221.             end)
  222.         end
  223.         return library3
  224.     end
  225.    
  226.     local function setDraggable()
  227.         Menu.Active = true
  228.         Menu.Draggable = true
  229.     end
  230.    
  231.     local function exitButton()
  232.         ScreenGui:Destroy()
  233.     end
  234.    
  235.     setDraggable()
  236.     Exit.MouseButton1Click:Connect(exitButton)
  237.    
  238.     return library2
  239. end
  240.  
  241. return library
Advertisement
Add Comment
Please, Sign In to add comment