joefromsansnite

Untitled

Oct 6th, 2021
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.11 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title, outlineColor)
  4.     title = (type(title) ~= "string") and "Title" or title
  5.     outlineColor = (typeof(outlineColor) ~= "Color3") and Color3.fromRGB(255, 255, 0) or outlineColor
  6.    
  7.     local userInputService = game:GetService("UserInputService")
  8.     local player = game.Players.LocalPlayer
  9.     local mouse = player:GetMouse()
  10.    
  11.     local X2 = Instance.new("ScreenGui")
  12.     local Menu = Instance.new("Frame")
  13.     local Background = Instance.new("Frame")
  14.     local UICorner = Instance.new("UICorner")
  15.     local Tabs = Instance.new("ScrollingFrame")
  16.     local UICorner_3 = Instance.new("UICorner")
  17.     local UIListLayout = Instance.new("UIListLayout")
  18.     local Frames = Instance.new("Frame")
  19.     local Title = Instance.new("TextLabel")
  20.     local Exit = Instance.new("TextButton")
  21.     local UICorner_8 = Instance.new("UICorner")
  22.     local UICorner_9 = Instance.new("UICorner")
  23.     local UIStroke = Instance.new("UIStroke")
  24.     local UIStroke2 = Instance.new("UIStroke")
  25.     local UIStroke3 = Instance.new("UIStroke")
  26.  
  27.     X2.Name = "X2"
  28.     X2.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  29.     X2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  30.  
  31.     Menu.Name = "Menu"
  32.     Menu.Parent = X2
  33.     Menu.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  34.     Menu.Position = UDim2.new(0.254218221, 0, 0.356340319, 0)
  35.     Menu.Size = UDim2.new(0, 436, 0, 21)
  36.  
  37.     UIStroke.Parent = Menu
  38.     UIStroke.Color = outlineColor
  39.  
  40.     Background.Name = "Background"
  41.     Background.Parent = Menu
  42.     Background.BackgroundColor3 = Color3.fromRGB(1, 1, 1)
  43.     Background.BackgroundTransparency = 0.500
  44.     Background.Position = UDim2.new(0, 0, 1.37705326, 0)
  45.     Background.Size = UDim2.new(0, 436, 0, 252)
  46.  
  47.     UIStroke2.Parent = Background
  48.     UIStroke2.Color = outlineColor
  49.  
  50.     UICorner.CornerRadius = UDim.new(0, 6)
  51.     UICorner.Parent = Background
  52.  
  53.     Tabs.Name = "Tabs"
  54.     Tabs.Parent = Background
  55.     Tabs.Active = true
  56.     Tabs.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  57.     Tabs.BorderSizePixel = 0
  58.     Tabs.Position = UDim2.new(0.128440365, 0, 0.0595238097, 0)
  59.     Tabs.Size = UDim2.new(0, 324, 0, 32)
  60.     Tabs.CanvasSize = UDim2.new(0, 2, 0, 0)
  61.     Tabs.ScrollBarThickness = 6
  62.     Tabs.AutomaticCanvasSize = Enum.AutomaticSize.X
  63.  
  64.     UIStroke3.Parent = Tabs
  65.     UIStroke3.Color = outlineColor
  66.  
  67.     UICorner_9.Parent = Tabs
  68.  
  69.     UIListLayout.Parent = Tabs
  70.     UIListLayout.FillDirection = Enum.FillDirection.Horizontal
  71.     UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  72.     UIListLayout.Padding = UDim.new(0, 5)
  73.  
  74.     Frames.Name = "Frames"
  75.     Frames.Parent = Background
  76.     Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77.     Frames.BackgroundTransparency = 1.000
  78.     Frames.Position = UDim2.new(0.128440365, 0, 0.222222224, 0)
  79.     Frames.Size = UDim2.new(0, 324, 0, 175)
  80.  
  81.     Title.Name = "Title"
  82.     Title.Parent = Menu
  83.     Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  84.     Title.BackgroundTransparency = 1.000
  85.     Title.Position = UDim2.new(0, 0, 0.0357140452, 0)
  86.     Title.Size = UDim2.new(0, 408, 0, 21)
  87.     Title.Font = Enum.Font.Code
  88.     Title.Text = title
  89.     Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  90.     Title.TextScaled = true
  91.     Title.TextSize = 14.000
  92.     Title.TextWrapped = true
  93.  
  94.     Exit.Parent = Menu
  95.     Exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  96.     Exit.BackgroundTransparency = 1.000
  97.     Exit.Position = UDim2.new(0.954128444, 0, 0.0317461938, 0)
  98.     Exit.Size = UDim2.new(0, 21, 0, 21)
  99.     Exit.Font = Enum.Font.SourceSans
  100.     Exit.Text = "X"
  101.     Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  102.     Exit.TextSize = 19.000
  103.  
  104.     UICorner_8.CornerRadius = UDim.new(0, 6)
  105.     UICorner_8.Parent = Menu
  106.  
  107.  
  108.     -- Local functions
  109.     local function setDraggable()
  110.         Menu.Active = true
  111.         Menu.Draggable = true
  112.     end
  113.     local function exitButton()
  114.         X2:Destroy()
  115.     end
  116.  
  117.     local function buttonClickEffect(button)
  118.         if button == nil then
  119.             return
  120.         end
  121.         local uis = game:GetService("UserInputService")
  122.  
  123.         local mouseLocation = uis:GetMouseLocation()
  124.         local absolutePosition = button.AbsolutePosition
  125.  
  126.         local effectXPosition = UDim2.new(0, mouseLocation.X-absolutePosition.X, 0, (mouseLocation.Y-absolutePosition.Y)-36)
  127.  
  128.         local ButtonEffect = Instance.new("ImageLabel")
  129.  
  130.         button.ClipsDescendants = true
  131.  
  132.         ButtonEffect.Name = "ButtonEffect"
  133.         ButtonEffect.Parent = button
  134.         ButtonEffect.AnchorPoint = Vector2.new(0.5, 0.5)
  135.         ButtonEffect.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  136.         ButtonEffect.BackgroundTransparency = 1.000
  137.         ButtonEffect.BorderSizePixel = 0
  138.         ButtonEffect.Position = UDim2.new(0, 0, 0, 0)
  139.         ButtonEffect.Size = UDim2.new(0, 25, 0, 25)
  140.         ButtonEffect.Image = "rbxassetid://7658630902"
  141.         ButtonEffect.ImageTransparency = 0.500
  142.         ButtonEffect.Position = effectXPosition
  143.  
  144.         ButtonEffect:TweenSize(UDim2.new(0, 175, 0, 175))
  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 createContainer(parent)
  156.         local Container = Instance.new("Frame")
  157.  
  158.         Container.Name = "Container"
  159.         Container.Parent = parent
  160.         Container.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  161.         Container.BackgroundTransparency = 1.000
  162.         Container.BorderSizePixel = 0
  163.         Container.Position = UDim2.new(0, 0, 0.200000003, 0)
  164.         Container.Size = UDim2.new(0, 380, 0, 42)
  165.  
  166.         return Container
  167.     end
  168.     local function createSeperator(parent)
  169.         local Seperator2_3 = Instance.new("Frame")
  170.         local Seperator_3 = Instance.new("Frame")
  171.  
  172.         Seperator2_3.Name = "Seperator2"
  173.         Seperator2_3.AnchorPoint = Vector2.new(0.5, 0.5)
  174.         Seperator2_3.Parent = parent
  175.         Seperator2_3.BackgroundColor3 = Color3.fromRGB(215, 215, 215)
  176.         Seperator2_3.Position = UDim2.new(0.43, 0, 1, 0)
  177.         Seperator2_3.Size = UDim2.new(0, 435, 0, 1)
  178.  
  179.         Seperator_3.Name = "Seperator"
  180.         Seperator_3.AnchorPoint = Vector2.new(0.5, 0.5)
  181.         Seperator_3.Parent = parent
  182.         Seperator_3.BackgroundColor3 = Color3.fromRGB(215, 215, 215)
  183.         Seperator_3.Position = UDim2.new(0.43, 0, 0, 0)
  184.         Seperator_3.Size = UDim2.new(0, 435, 0, 1)
  185.     end
  186.     local function hideFrames()
  187.         for _, frame in pairs(Frames:GetChildren()) do
  188.             frame.Visible = false
  189.         end
  190.     end
  191.  
  192.     local library2 = {}
  193.  
  194.     function library2:SetOutlineColor(color)
  195.         for _, v in pairs(X2:GetDescendants()) do
  196.             if v:IsA("UIStroke") then
  197.                 v.Color = color
  198.             elseif v.Name == "ToggleButton" or v.Name == "FillFrame" then
  199.                 v.BackgroundColor3 = color
  200.             end
  201.         end
  202.     end
  203.     function library2:Rainbow()
  204.         spawn(function()
  205.             local i = 0
  206.             while true do
  207.                 i += 1
  208.                 local color = Color3.fromHSV(i/360, 1, 1)
  209.                 library2:SetOutlineColor(color)
  210.  
  211.                 if i >= 360 then
  212.                     i = 0
  213.                 end
  214.                 wait()
  215.             end
  216.         end)
  217.     end
  218.  
  219.     function library2:NewTab(text)
  220.         text = (type(text) ~= "string") and "Tab" or text
  221.  
  222.         local TabButton = Instance.new("TextButton")
  223.         local UICorner_2 = Instance.new("UICorner")
  224.         local UICorner_3 = Instance.new("UICorner")
  225.         local UIStroke = Instance.new("UIStroke")
  226.         local UIStroke2 = Instance.new("UIStroke")
  227.         local Frame = Instance.new("Frame")
  228.         local MainFrame = Instance.new("ScrollingFrame")
  229.         local UIListLayout_2 = Instance.new("UIListLayout")
  230.  
  231.         TabButton.Name = "TabButton"
  232.         TabButton.Parent = Tabs
  233.         TabButton.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  234.         TabButton.BackgroundTransparency = 1.000
  235.         TabButton.BorderSizePixel = 0
  236.         TabButton.Size = UDim2.new(0, 90, 0, 20)
  237.         TabButton.Font = Enum.Font.Code
  238.         TabButton.Text = text
  239.         TabButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  240.         TabButton.TextSize = 14.000
  241.  
  242.         Frame.Parent = TabButton
  243.         Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  244.         Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  245.         Frame.BackgroundTransparency = 1.000
  246.         Frame.Position = UDim2.new(0.5, 0, 0.590740979, 0)
  247.         Frame.Size = UDim2.new(0, 90, 0, 20)
  248.  
  249.         UICorner_2.Parent = Frame
  250.  
  251.         UIStroke.Parent = Frame
  252.         UIStroke.Color = outlineColor
  253.  
  254.         MainFrame.Name = "MainFrame"
  255.         MainFrame.Parent = Frames
  256.         MainFrame.Active = true
  257.         MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  258.         MainFrame.BorderSizePixel = 0
  259.         MainFrame.Position = UDim2.new(-0.00118926167, 0, -0.000634923577, 0)
  260.         MainFrame.Size = UDim2.new(0, 324, 0, 175)
  261.         MainFrame.ScrollBarThickness = 6
  262.         MainFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  263.  
  264.         UICorner_3.Parent = MainFrame
  265.  
  266.         UIStroke2.Parent = MainFrame
  267.         UIStroke2.Color = outlineColor
  268.  
  269.         UIListLayout_2.Parent = MainFrame
  270.  
  271.         hideFrames()
  272.         TabButton.MouseButton1Down:Connect(function()
  273.             buttonClickEffect(Frame)
  274.             hideFrames()
  275.             MainFrame.Visible = true
  276.         end)
  277.  
  278.         local library3 = {}
  279.  
  280.         function library3:NewButton(text, callback)
  281.             text = (type(text) ~= "string") and "Button" or text
  282.             callback = (type(callback) ~= "function") and function()
  283.                 print("Clicked!")
  284.             end or callback
  285.  
  286.             local TextButton = Instance.new("TextButton")
  287.             local Frame_3 = Instance.new("Frame")
  288.             local UICorner_7 = Instance.new("UICorner")
  289.             local UIStroke = Instance.new("UIStroke")
  290.             local Container = createContainer(MainFrame)
  291.             local Seperator = createSeperator(Container)
  292.  
  293.             TextButton.Parent = Container
  294.             TextButton.AnchorPoint = Vector2.new(0.5, 0.5)
  295.             TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  296.             TextButton.BackgroundTransparency = 1.000
  297.             TextButton.Position = UDim2.new(0.43, 0, 0.5, 0)
  298.             TextButton.Size = UDim2.new(0, 300, 0, 28)
  299.             TextButton.Font = Enum.Font.Code
  300.             TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  301.             TextButton.TextSize = 14.000
  302.             TextButton.Text = text
  303.  
  304.             Frame_3.Parent = TextButton
  305.             Frame_3.AnchorPoint = Vector2.new(0.5, 0.5)
  306.             Frame_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  307.             Frame_3.BackgroundTransparency = 1.000
  308.             Frame_3.Position = UDim2.new(0.5, 0, 0.481481493, 0)
  309.             Frame_3.Size = UDim2.new(0, 300, 0, 28)
  310.  
  311.             UICorner_7.Parent = Frame_3
  312.             UIStroke.Parent = Frame_3
  313.             UIStroke.Color = outlineColor
  314.  
  315.             TextButton.MouseButton1Down:Connect(function()
  316.                 buttonClickEffect(Frame_3)
  317.                 callback()
  318.             end)
  319.         end
  320.         function library3:NewTextBox(text, callback)
  321.             text = (type(text) ~= "string") and "Placeholder" or text
  322.             callback = (type(callback) ~= "function") and function()
  323.                 print("Lost Focus!")
  324.             end or callback
  325.  
  326.             local TextBox = Instance.new("TextBox")
  327.             local Frame_2 = Instance.new("Frame")
  328.             local UICorner_4 = Instance.new("UICorner")
  329.             local Seperator2 = Instance.new("Frame")
  330.             local Seperator = Instance.new("Frame")
  331.             local UIStroke = Instance.new("UIStroke")
  332.             local Container = createContainer(MainFrame)
  333.             local Seperator = createSeperator(Container)
  334.  
  335.             TextBox.Parent = Container
  336.             TextBox.AnchorPoint = Vector2.new(0.5, 0.5)
  337.             TextBox.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  338.             TextBox.BackgroundTransparency = 1.000
  339.             TextBox.Position = UDim2.new(0.43, 0, 0.5, 0)
  340.             TextBox.Size = UDim2.new(0, 300, 0, 28)
  341.             TextBox.Font = Enum.Font.Code
  342.             TextBox.PlaceholderText = "Textbox"
  343.             TextBox.Text = text
  344.             TextBox.PlaceholderText = text
  345.             TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  346.             TextBox.TextSize = 14.000
  347.             TextBox.TextStrokeColor3 = Color3.fromRGB(255, 255, 255)
  348.  
  349.             Frame_2.Parent = TextBox
  350.             Frame_2.AnchorPoint = Vector2.new(0.5, 0.5)
  351.             Frame_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  352.             Frame_2.BackgroundTransparency = 1.000
  353.             Frame_2.Position = UDim2.new(0.5, 0, 0.481481493, 0)
  354.             Frame_2.Size = UDim2.new(0, 300, 0, 28)
  355.  
  356.             UICorner_4.Parent = Frame_2
  357.             UIStroke.Parent = Frame_2
  358.             UIStroke.Color = outlineColor
  359.  
  360.             TextBox.FocusLost:Connect(function()
  361.                 callback(TextBox.Text)
  362.             end)
  363.         end
  364.         function library3:NewToggle(text, callback)
  365.             text = (type(text) ~= "string") and "Toggle" or text
  366.             callback = (type(callback) ~= "function") and function()
  367.                 print("Toggled!")
  368.             end or callback
  369.  
  370.             local Toggle = Instance.new("Frame")
  371.             local UICorner_5 = Instance.new("UICorner")
  372.             local ToggleButton = Instance.new("TextButton")
  373.             local UICorner_6 = Instance.new("UICorner")
  374.             local TextLabel = Instance.new("TextLabel")
  375.             local Seperator2_2 = Instance.new("Frame")
  376.             local Seperator_2 = Instance.new("Frame")
  377.             local UIStroke = Instance.new("UIStroke")
  378.             local Container = createContainer(MainFrame)
  379.             local Seperator = createSeperator(Container)
  380.  
  381.             local toggled = true
  382.  
  383.             Toggle.Name = "Toggle"
  384.             Toggle.Parent = Container
  385.             Toggle.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  386.             Toggle.BackgroundTransparency = 1.000
  387.             Toggle.BorderSizePixel = 0
  388.             Toggle.Position = UDim2.new(0.03, 0, 0.22, 0)
  389.             Toggle.Size = UDim2.new(0, 25, 0, 25)
  390.  
  391.             UICorner_5.CornerRadius = UDim.new(1, 0)
  392.             UICorner_5.Parent = Toggle
  393.  
  394.             ToggleButton.Name = "ToggleButton"
  395.             ToggleButton.Parent = Toggle
  396.             ToggleButton.AnchorPoint = Vector2.new(0.5, 0.5)
  397.             ToggleButton.BackgroundColor3 = outlineColor
  398.             ToggleButton.Position = UDim2.new(0.5, 0, 0.5, 0)
  399.             ToggleButton.Size = UDim2.new(0, 15, 0, 15)
  400.             ToggleButton.AutoButtonColor = false
  401.             ToggleButton.Font = Enum.Font.SourceSans
  402.             ToggleButton.Text = ""
  403.             ToggleButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  404.             ToggleButton.TextSize = 14.000
  405.  
  406.             UICorner_6.CornerRadius = UDim.new(1, 0)
  407.             UICorner_6.Parent = ToggleButton
  408.  
  409.             UIStroke.Parent = Toggle
  410.             UIStroke.Color = outlineColor
  411.  
  412.             TextLabel.Parent = Toggle
  413.             TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  414.             TextLabel.BackgroundTransparency = 1.000
  415.             TextLabel.Position = UDim2.new(1.293, 0, -0.153, 0)
  416.             TextLabel.Size = UDim2.new(0, 267, 0, 31)
  417.             TextLabel.Font = Enum.Font.Code
  418.             TextLabel.Text = text
  419.             TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  420.             TextLabel.TextSize = 14.000
  421.             TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  422.  
  423.             ToggleButton.MouseButton1Down:Connect(function()
  424.                 toggled = not toggled
  425.                 ToggleButton.BackgroundTransparency = (toggled == true) and 0 or 1
  426.  
  427.                 spawn(function()
  428.                     ToggleButton.Size = UDim2.new(0, 18, 0, 18)
  429.                     wait(.05)
  430.                     ToggleButton.Size = UDim2.new(0, 15, 0, 15)
  431.                 end)
  432.                 callback(toggled)
  433.             end)
  434.         end
  435.         function library3:NewSlider(text, min, max, callback)
  436.             text = (type(text) ~= "string") and "Slider" or text
  437.             min = (type(min) ~= "number") and 0 or min
  438.             max = (type(max) ~= "number") and 10 or max
  439.             callback = (type(callback) ~= "function") and function()
  440.                 print("Slider")
  441.             end or callback
  442.            
  443.             local Slider = Instance.new("Frame")
  444.             local UICorner = Instance.new("UICorner")
  445.             local FillFrame = Instance.new("Frame")
  446.             local UICorner_2 = Instance.new("UICorner")
  447.             local TextLabel = Instance.new("TextLabel")
  448.             local MoveButton = Instance.new("TextButton")
  449.             local UICorner_3 = Instance.new("UICorner")
  450.             local TextLabel_2 = Instance.new("TextLabel")
  451.             local UIStroke = Instance.new("UIStroke")
  452.             local Container = createContainer(MainFrame)
  453.             local Seperator = createSeperator(Container)
  454.            
  455.             Slider.Name = "Slider"
  456.             Slider.Parent = Container
  457.             Slider.AnchorPoint = Vector2.new(0.5, 0.5)
  458.             Slider.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  459.             Slider.BackgroundTransparency = 1.000
  460.             Slider.Position = UDim2.new(0.3000002, 0, 0.600000024, 0)
  461.             Slider.Size = UDim2.new(0, 200, 0, 10)
  462.  
  463.             UICorner.Parent = Slider
  464.             UIStroke.Parent = Slider
  465.            
  466.             FillFrame.Name = "FillFrame"
  467.             FillFrame.Parent = Slider
  468.             FillFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  469.             FillFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  470.             FillFrame.Position = UDim2.new(0.00100000005, 0, 0.5, 0)
  471.             FillFrame.Size = UDim2.new(0, 0, 0, 10)
  472.  
  473.             UICorner_2.Parent = FillFrame
  474.  
  475.             TextLabel.Parent = Slider
  476.             TextLabel.AnchorPoint = Vector2.new(0.5, 0.5)
  477.             TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  478.             TextLabel.BackgroundTransparency = 1.000
  479.             TextLabel.Position = UDim2.new(1.2852447, 0, 0.5, 0)
  480.             TextLabel.Size = UDim2.new(0, 104, 0, 15)
  481.             TextLabel.Font = Enum.Font.Code
  482.             TextLabel.Text = min
  483.             TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  484.             TextLabel.TextScaled = true
  485.             TextLabel.TextSize = 14.000
  486.             TextLabel.TextWrapped = true
  487.             TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  488.  
  489.             MoveButton.Name = "MoveButton"
  490.             MoveButton.Parent = Slider
  491.             MoveButton.AnchorPoint = Vector2.new(0.5, 0.5)
  492.             MoveButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  493.             MoveButton.Position = UDim2.new(0, 0, 0.5, 0)
  494.             MoveButton.Size = UDim2.new(0, 10, 0, 10)
  495.             MoveButton.Font = Enum.Font.SourceSans
  496.             MoveButton.Text = ""
  497.             MoveButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  498.             MoveButton.TextSize = 14.000
  499.             MoveButton.AutoButtonColor = false
  500.            
  501.             UICorner_3.CornerRadius = UDim.new(1, 0)
  502.             UICorner_3.Parent = MoveButton
  503.  
  504.             TextLabel_2.Parent = Slider
  505.             TextLabel_2.AnchorPoint = Vector2.new(0.5, 0.5)
  506.             TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  507.             TextLabel_2.BackgroundTransparency = 1.000
  508.             TextLabel_2.Position = UDim2.new(0.524688601, 0, -0.9, 0)
  509.             TextLabel_2.Size = UDim2.new(0, 200, 0, 15)
  510.             TextLabel_2.Font = Enum.Font.Code
  511.             TextLabel_2.Text = text
  512.             TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  513.             TextLabel_2.TextScaled = true
  514.             TextLabel_2.TextSize = 14.000
  515.             TextLabel_2.TextWrapped = true
  516.             TextLabel_2.TextXAlignment = Enum.TextXAlignment.Left
  517.  
  518.             local holding = false
  519.            
  520.             MoveButton.MouseButton1Down:Connect(function()
  521.                 holding = true
  522.                
  523.                 while holding do
  524.                     local mousePosition = userInputService:GetMouseLocation()
  525.                    
  526.                     local xPos = (mousePosition.X-Slider.AbsolutePosition.X)/Slider.AbsoluteSize.X
  527.                     xPos = math.clamp(xPos, 0, 1)
  528.                    
  529.                     local value = (max - min) * xPos + min
  530.                    
  531.                     TextLabel.Text = tostring(math.round(value))
  532.                    
  533.                     MoveButton.Size = UDim2.new(0, 12, 0, 12)
  534.                     FillFrame.Size = UDim2.new(xPos, 0, 0, 10)
  535.                     FillFrame.Position = UDim2.new(xPos/2, 0, 0.5, 0)
  536.                     MoveButton.Position = UDim2.new(xPos, 0, 0.5, 0)
  537.                    
  538.                     callback(value)
  539.                     wait()
  540.                 end
  541.             end)
  542.             MoveButton.MouseButton1Up:Connect(function()
  543.                 holding = false
  544.                 MoveButton.Size = UDim2.new(0, 10, 0, 10)
  545.             end)
  546.             mouse.Button1Up:Connect(function()
  547.                 holding = false
  548.                 MoveButton.Size = UDim2.new(0, 10, 0, 10)
  549.             end)
  550.         end
  551.         return library3
  552.     end
  553.  
  554.  
  555.     -- Call local functions
  556.     setDraggable()
  557.     Exit.MouseButton1Down:Connect(function()
  558.         exitButton()
  559.     end)
  560.  
  561.     return library2
  562. end
  563.  
  564. return library
Advertisement
Add Comment
Please, Sign In to add comment