Advertisement
joefromsansnite

Untitled

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