Advertisement
XZTablets

FlatUILibrary

Mar 28th, 2020
2,362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.66 KB | None | 0 0
  1. local library = {}
  2.  
  3. local ts = game:GetService("TweenService")
  4.  
  5. function library:Create(clips, title, key_toggle)
  6.     if not title then
  7.         title = "FlatUI"
  8.     end
  9.     if not key_toggle then
  10.         key_toggle = "Q"
  11.     end
  12.     local new_gui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
  13.     new_gui.Name = title
  14.     new_gui.ResetOnSpawn = false
  15.     new_gui.ZIndexBehavior = Enum.ZIndexBehavior.Global
  16.    
  17.     local container = Instance.new("Frame")
  18.     local main = Instance.new("Frame")
  19.     local options = Instance.new("Frame")
  20.     local alert_container = Instance.new("Frame")
  21.    
  22.     alert_container.Name = "Alerts"
  23.     alert_container.Parent = new_gui
  24.     alert_container.BackgroundTransparency = 1
  25.     alert_container.Size = UDim2.new(0, 600, 0, 300)
  26.     alert_container.Position = UDim2.new(0.5, -300, 1, -150)
  27.    
  28.     local ALERTLIST = Instance.new("UIListLayout", alert_container)
  29.     ALERTLIST.Parent = alert_container
  30.     ALERTLIST.SortOrder = Enum.SortOrder.LayoutOrder
  31.     ALERTLIST.Padding = UDim.new(0, 0)
  32.    
  33.     container.Name = "Container"
  34.     container.Parent = new_gui
  35.     container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  36.     container.BorderSizePixel = 0
  37.     container.Size = UDim2.new(0, 600, 0, 350)
  38.     container.Position = UDim2.new(0.5, -(300), 0.5, -(175))
  39.     container.ClipsDescendants = clips
  40.    
  41.     local name_label = Instance.new("TextLabel", container)
  42.     name_label.Name = "Title"
  43.     name_label.BackgroundTransparency = 1
  44.     name_label.Size = UDim2.new(1, 0, 0, 35)
  45.     name_label.Font = Enum.Font.SourceSans
  46.     name_label.Text = "     " .. title
  47.     name_label.TextColor3 = Color3.fromRGB(255, 255, 255)
  48.     name_label.TextSize = 20
  49.     name_label.TextXAlignment = Enum.TextXAlignment.Left
  50.     name_label.ZIndex = 10
  51.    
  52.     local name_bar = Instance.new("Frame", name_label)
  53.     name_bar.Name = "ColourBar"
  54.     name_bar.BackgroundColor3 = Color3.fromRGB(165, 155, 255)
  55.     name_bar.BorderSizePixel = 0
  56.     name_bar.Size = UDim2.new(0, 4, 0, 25)
  57.     name_bar.Position = UDim2.new(0, 0, 0, 5)
  58.     name_bar.ZIndex = 9
  59.    
  60.     options.Name = "Options"
  61.     options.Parent = container
  62.     options.BackgroundColor3 = Color3.fromRGB(56, 56, 56)
  63.     options.BorderSizePixel = 0
  64.     options.Position = UDim2.new(0, 0, 0, 35)
  65.     options.Size = UDim2.new(0, 135, 0, 315)
  66.    
  67.     local dragging = false
  68.     local in_view = false
  69.     local last_mousex
  70.     local last_mousey
  71.    
  72.     spawn(function()
  73.         name_label.MouseEnter:Connect(function()
  74.             in_view = true
  75.         end)
  76.            
  77.         name_label.MouseLeave:Connect(function()
  78.             in_view = false
  79.         end)
  80.            
  81.         local mouse = game.Players.LocalPlayer:GetMouse()
  82.            
  83.         mouse.Button1Down:Connect(function()
  84.             if in_view then
  85.                 dragging = true
  86.                 last_mousex = mouse.X
  87.                 last_mousey = mouse.Y
  88.                 while dragging do
  89.                     container.Position = container.Position + UDim2.new(0, (mouse.X - last_mousex), 0, (mouse.Y - last_mousey))
  90.                     last_mousex = mouse.X
  91.                     last_mousey = mouse.Y
  92.                     wait()
  93.                 end
  94.             end
  95.         end)
  96.            
  97.         mouse.Button1Up:Connect(function()
  98.             if in_view then
  99.                 dragging = false
  100.             end
  101.         end)
  102.     end)
  103.    
  104.     local minimised = false
  105.    
  106.     local close_button = Instance.new("ImageButton", name_label)
  107.     close_button.Name = "Close"
  108.     close_button.BackgroundTransparency = 1
  109.     close_button.Position = UDim2.new(0.95, 0, 0.5, -(5))
  110.     close_button.Size = UDim2.new(0, 10, 0, 10)
  111.     close_button.Image = "rbxassetid://3570695787"
  112.     close_button.ImageColor3 = Color3.fromRGB(255, 110, 110)
  113.    
  114.     local mini_button = Instance.new("ImageButton", name_label)
  115.     mini_button.Name = "Minimise"
  116.     mini_button.BackgroundTransparency = 1
  117.     mini_button.Position = UDim2.new(0.905, 0, 0.5, -(5))
  118.     mini_button.Size = UDim2.new(0, 10, 0, 10)
  119.     mini_button.Image = "rbxassetid://3570695787"
  120.     mini_button.ImageColor3 = Color3.fromRGB(255, 185, 65)
  121.    
  122.     mini_button.MouseButton1Click:Connect(function()
  123.         minimised = not minimised
  124.         if minimised then
  125.             container.ClipsDescendants = true
  126.             local tween_info = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
  127.             container:TweenSize(UDim2.new(0, 600, 0, 35), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
  128.             local tween = ts:Create(mini_button, tween_info, {ImageColor3 = Color3.fromRGB(160, 255, 165)})
  129.             wait(0.5)
  130.             tween:Play()
  131.         else
  132.             local tween_info = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
  133.             container:TweenSize(UDim2.new(0, 600, 0, 350), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
  134.             local tween = ts:Create(mini_button, tween_info, {ImageColor3 = Color3.fromRGB(255, 185, 65)})
  135.             wait(0.5)
  136.             tween:Play()
  137.             container.ClipsDescendants = clips
  138.         end
  139.     end)
  140.    
  141.     close_button.MouseButton1Click:Connect(function()
  142.         new_gui:Destroy()
  143.     end)
  144.        
  145.     main.Name = "Main"
  146.     main.Parent = container
  147.     main.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  148.     main.BorderSizePixel = 0
  149.     main.Position = UDim2.new(0, 140, 0, 35)
  150.     main.Size = UDim2.new(0, 460, 0, 315)
  151.    
  152.     local UILIST = Instance.new("UIListLayout")
  153.     UILIST.Parent = options
  154.     UILIST.SortOrder = Enum.SortOrder.LayoutOrder
  155.     UILIST.Padding = UDim.new(0.01, 0)
  156.    
  157.     local toggle = false
  158.     local input = false
  159.    
  160.     game:GetService("UserInputService").InputEnded:Connect(function(key)
  161.         if key.KeyCode == Enum.KeyCode[key_toggle] and not input then
  162.             toggle = not toggle
  163.             if toggle then
  164.                 container:TweenPosition(container.Position + UDim2.new(0, 0, 2, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5, true)
  165.             else
  166.                 container:TweenPosition(container.Position + UDim2.new(0, 0, -2, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5, true)
  167.             end
  168.         end
  169.     end)
  170.        
  171.     local options_lib = {}
  172.     local n_options = 0
  173.    
  174.     function options_lib:AddOption(option)
  175.         local new_button = Instance.new("TextButton", options)
  176.         new_button.BackgroundTransparency = 1
  177.         new_button.Size = UDim2.new(1, 0, 0, 30)
  178.         new_button.Font = Enum.Font.SourceSans
  179.         new_button.Text = "    " .. tostring(option)
  180.         new_button.TextColor3 = Color3.fromRGB(255, 255, 255)
  181.         new_button.TextSize = 20
  182.         new_button.TextXAlignment = Enum.TextXAlignment.Left
  183.        
  184.         local button_effect = Instance.new("Frame", new_button)
  185.         button_effect.Name = "Effect"
  186.         button_effect.Size = UDim2.new(0, 4, 1, 0)
  187.         button_effect.Position = UDim2.new(0, 0, 0, 0)
  188.         button_effect.Visible = false
  189.         button_effect.BorderSizePixel = 0
  190.         button_effect.BackgroundColor3 = Color3.fromRGB(165, 155, 255)
  191.        
  192.         new_button.MouseButton1Click:Connect(function()
  193.             for i,v in pairs(new_gui.Container.Main:GetChildren()) do
  194.                 v.Visible = false
  195.             end
  196.             for i,v in pairs(new_gui.Container.Options:GetChildren()) do
  197.                 if v:IsA("TextButton") then
  198.                     v.Effect.Visible = false
  199.                 end
  200.             end
  201.             new_gui.Container.Main[option].Visible = true
  202.             button_effect.Visible = true
  203.             for i = 1, 0, -0.1 do
  204.                 button_effect.BackgroundTransparency = i
  205.                 wait()
  206.             end
  207.         end)
  208.            
  209.         local new_frame = Instance.new("Frame", main)
  210.         if n_options == 0 then
  211.             new_frame.Visible = true
  212.             button_effect.Visible = true
  213.         else
  214.             new_frame.Visible = false
  215.             button_effect.Visible = false
  216.         end
  217.         n_options = n_options + 1
  218.         new_frame.Name = option
  219.         new_frame.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  220.         new_frame.BorderSizePixel = 0
  221.         new_frame.Size = main.Size
  222.         local list_layout = Instance.new("UIListLayout", main[option])
  223.         local ui_padding = Instance.new("UIPadding", main[option])
  224.         list_layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  225.         list_layout.SortOrder = Enum.SortOrder.LayoutOrder
  226.         list_layout.Padding = UDim.new(0.03, 0)
  227.         ui_padding.PaddingTop = UDim.new(0.03, 0)
  228.        
  229.         local cheats_lib = {}
  230.  
  231.         function cheats_lib:AddLabel(text)
  232.             local new_label = Instance.new("TextLabel", new_frame)
  233.             new_label.Name = "JustALabel"
  234.             new_label.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  235.             new_label.BorderSizePixel = 0
  236.             new_label.Size = UDim2.new(0.95, 0, 0, 20)
  237.             new_label.Font = Enum.Font.SourceSans
  238.             new_label.Text = text
  239.             new_label.TextColor3 = Color3.fromRGB(255, 255, 255)
  240.             new_label.TextSize = 18
  241.             new_label.TextXAlignment = Enum.TextXAlignment.Center
  242.             new_label.ClipsDescendants = true
  243.         end
  244.  
  245.         function cheats_lib:AddHeader(text)
  246.             local new_label = Instance.new("TextLabel", new_frame)
  247.             new_label.Name = "JustALabel"
  248.             new_label.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  249.             new_label.BorderSizePixel = 0
  250.             new_label.Size = UDim2.new(0.95, 0, 0, 30)
  251.             new_label.Font = Enum.Font.SourceSans
  252.             new_label.Text = text
  253.             new_label.TextColor3 = Color3.fromRGB(255, 255, 255)
  254.             new_label.TextSize = 20
  255.             new_label.TextXAlignment = Enum.TextXAlignment.Center
  256.             new_label.ClipsDescendants = true
  257.         end
  258.        
  259.         function cheats_lib:AddButton(name, callback)
  260.             local button_container = Instance.new("TextButton", new_frame)
  261.             button_container.Name = string.gsub(name, " ", "").."BTN"
  262.             button_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  263.             button_container.BorderSizePixel = 0
  264.             button_container.Size = UDim2.new(0.95, 0, 0, 20)
  265.             button_container.Font = Enum.Font.SourceSans
  266.             button_container.Text = name
  267.             button_container.TextColor3 = Color3.fromRGB(255, 255, 255)
  268.             button_container.TextSize = 18
  269.             button_container.TextXAlignment = Enum.TextXAlignment.Center
  270.             button_container.ClipsDescendants = true
  271.             button_container.MouseButton1Click:Connect(callback)
  272.         end
  273.        
  274.         function cheats_lib:AddToggle(title, state, callback)
  275.             local button_container = Instance.new("TextButton", new_frame)
  276.             button_container.Name = string.gsub(title, " ", "").."TGL"
  277.             button_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  278.             button_container.BorderSizePixel = 0
  279.             button_container.Size = UDim2.new(0.95, 0, 0, 20)
  280.             button_container.Font = Enum.Font.SourceSans
  281.             button_container.Text = title
  282.             button_container.TextColor3 = Color3.fromRGB(255, 255, 255)
  283.             button_container.TextSize = 18
  284.            
  285.             local toggle_track = Instance.new("Frame", button_container)
  286.             toggle_track.Name = "ToggleEffect"
  287.             toggle_track.BackgroundColor3 = Color3.fromRGB(255, 75, 75)
  288.             toggle_track.BorderSizePixel = 0
  289.             toggle_track.Position = UDim2.new(1, -16, 0, 4)
  290.             toggle_track.Size = UDim2.new(0, 12, 0, 12)
  291.            
  292.             if state then
  293.                 toggle_track.BackgroundColor3 = Color3.fromRGB(185, 255, 20)
  294.             else
  295.                 toggle_track.BackgroundColor3 = Color3.fromRGB(255, 75, 75)
  296.             end
  297.            
  298.             button_container.MouseButton1Click:Connect(function()
  299.                 state = not state
  300.                 if state then
  301.                     toggle_track.BackgroundColor3 = Color3.fromRGB(185, 255, 20)
  302.                     callback(true)
  303.                 else
  304.                     toggle_track.BackgroundColor3 = Color3.fromRGB(255, 75, 75)
  305.                     callback(false)
  306.                 end
  307.             end)
  308.         end
  309.        
  310.         function cheats_lib:AddBox(title, default, placeholder, cleartext, callback)
  311.             local box_container = Instance.new("Frame", new_frame)
  312.             local new_label = Instance.new("TextLabel", box_container)
  313.             local new_box = Instance.new("TextBox", box_container)
  314.            
  315.             box_container.Name = string.gsub(title, " ", "").."BOX"
  316.             box_container.Size = UDim2.new(0.95, 0, 0, 20)
  317.             box_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  318.             box_container.BorderSizePixel = 0
  319.            
  320.             new_label.Text = "   "..title..":"
  321.             new_label.BackgroundTransparency = 1
  322.             new_label.Size = UDim2.new(0.5, 0, 1, 0)
  323.             new_label.Font = Enum.Font.SourceSansSemibold
  324.             new_label.TextColor3 = Color3.fromRGB(255, 255, 255)
  325.             new_label.TextSize = 18
  326.             new_label.TextXAlignment = Enum.TextXAlignment.Left
  327.            
  328.             new_box.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
  329.             new_box.BorderSizePixel = 0
  330.             new_box.Position = UDim2.new(0.5, 4, 0.2, 0)
  331.             new_box.Size = UDim2.new(0.5, -8, 0.6, 0)
  332.             new_box.Font = Enum.Font.SourceSansSemibold
  333.             new_box.Text = default
  334.             new_box.TextColor3 = Color3.fromRGB(255, 255, 255)
  335.             new_box.TextSize = 15
  336.             new_box.ClearTextOnFocus = cleartext
  337.            
  338.             new_box.Focused:Connect(function()
  339.                 input = true
  340.             end)
  341.                
  342.             new_box.FocusLost:Connect(function()
  343.                 callback(new_box.Text)
  344.                 input = false
  345.             end)
  346.         end
  347.        
  348.         function cheats_lib:AddDropdown(name, options_table, callback)
  349.             local open = false
  350.             local d_container = Instance.new("Frame", new_frame)
  351.             d_container.Name = string.gsub(name, " ", "").."DRP"
  352.             d_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  353.             d_container.BorderSizePixel = 0
  354.             d_container.Size = UDim2.new(0.95, 0, 0, 20)
  355.            
  356.             local d_list = Instance.new("UIListLayout", d_container)
  357.             d_list.HorizontalAlignment = Enum.HorizontalAlignment.Center
  358.             d_list.Padding = UDim.new(0, 0)
  359.             d_list.SortOrder = Enum.SortOrder.LayoutOrder
  360.            
  361.             local d_button = Instance.new("TextButton", d_container)
  362.             d_button.BackgroundTransparency = 1
  363.             d_button.Position = UDim2.new(0, 0, 0, 0)
  364.             d_button.Size = UDim2.new(1, 0, 1, 0)
  365.             d_button.Font = Enum.Font.SourceSansSemibold
  366.             d_button.Text = name
  367.             d_button.TextColor3 = Color3.fromRGB(255, 255, 255)
  368.             d_button.TextSize = 18
  369.             d_button.TextXAlignment = Enum.TextXAlignment.Center
  370.            
  371.             local d_status = Instance.new("ImageLabel", d_button)
  372.             d_status.Image = "http://www.roblox.com/asset/?id=71659683"
  373.             d_status.Size = UDim2.new(0, 12, 0, 12)
  374.             d_status.Position = UDim2.new(0, 4, 0, 4)
  375.             d_status.BackgroundTransparency = 1
  376.            
  377.             local d_frame = Instance.new("Frame", d_container)
  378.             d_frame.Size = UDim2.new(1, 0, 0, 0)
  379.             d_frame.BackgroundColor3 = Color3.fromRGB(42, 42, 42)
  380.             d_frame.BorderSizePixel = 0
  381.             d_frame.ClipsDescendants = true
  382.             d_frame.ZIndex = 3
  383.            
  384.             local frame_layout = Instance.new("UIListLayout", d_frame)
  385.             frame_layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  386.             frame_layout.SortOrder = Enum.SortOrder.LayoutOrder
  387.            
  388.             for i,v in pairs(options_table) do
  389.                 local new_d_option = Instance.new("TextButton", d_frame)
  390.                 new_d_option.BorderSizePixel = 0
  391.                 new_d_option.Size = UDim2.new(1, 0, 0, 20)
  392.                 new_d_option.Font = Enum.Font.SourceSansSemibold
  393.                 new_d_option.Text = tostring(v)
  394.                 new_d_option.TextSize = 16
  395.                 new_d_option.TextColor3 = Color3.fromRGB(255, 255, 255)
  396.                 new_d_option.BackgroundTransparency = 1
  397.                 new_d_option.TextXAlignment = Enum.TextXAlignment.Center
  398.                 new_d_option.ZIndex = 3
  399.                 new_d_option.MouseButton1Click:Connect(function()
  400.                     callback(new_d_option.Text)
  401.                 end)
  402.             end
  403.            
  404.             d_button.MouseButton1Click:Connect(function()
  405.                 open = not open
  406.                 if open then
  407.                     ts:Create(d_status, TweenInfo.new(0.5), {Rotation = 90}):Play()
  408.                     d_frame:TweenSize(UDim2.new(1, 0, 0, #options_table * 20), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
  409.                 else
  410.                     ts:Create(d_status, TweenInfo.new(0.5), {Rotation = 0}):Play()
  411.                     d_frame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
  412.                 end
  413.             end)
  414.         end
  415.        
  416.         function cheats_lib:SendAlert(message, type_, wait_time)
  417.             local alert_label = Instance.new("TextLabel", alert_container)
  418.             alert_label.Size = UDim2.new(1, 0, 0, 30)
  419.             alert_label.BackgroundColor3 = Color3.fromRGB(84, 84, 84)
  420.             alert_label.BorderSizePixel = 0
  421.             alert_label.Font = Enum.Font.SourceSansSemibold
  422.             alert_label.Text = ("   ")..message
  423.             alert_label.TextXAlignment = Enum.TextXAlignment.Left
  424.             alert_label.TextColor3 = Color3.fromRGB(255, 255, 255)
  425.             alert_label.TextSize = 18
  426.            
  427.             local alert_effect = Instance.new("Frame", alert_label)
  428.             alert_effect.BackgroundColor3 = Color3.fromRGB(49, 49, 49)
  429.             alert_effect.BorderSizePixel = 0
  430.             alert_effect.Position = UDim2.new(0, 0, 1, 0)
  431.             alert_effect.Size = UDim2.new(1, 0, 0, 3)
  432.            
  433.             local alert_image = Instance.new("ImageLabel", alert_label)
  434.             alert_image.BackgroundTransparency = 1
  435.             alert_image.Position = UDim2.new(1, -23, 0.5, -8)
  436.             alert_image.Size = UDim2.new(0, 16, 0, 16)
  437.            
  438.             if type_ then
  439.                 alert_image.Image = "http://www.roblox.com/asset/?id=4831651949"
  440.             else
  441.                 alert_image.Image = "http://www.roblox.com/asset/?id=4831651758"
  442.             end
  443.            
  444.             wait(wait_time)
  445.            
  446.             alert_label:Destroy()
  447.         end
  448.        
  449.         function cheats_lib:AddSlider(title, min, max, default, callback)
  450.             local s_container = Instance.new("Frame", new_frame)
  451.             local s_title = Instance.new("TextLabel", s_container)
  452.             local s_button = Instance.new("TextButton", s_container)
  453.             local s_frame = Instance.new("Frame", s_container)
  454.             local s_value = Instance.new("TextLabel", s_container)
  455.            
  456.             s_container.Name = string.gsub(title, " ", "").."SLD"
  457.             s_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  458.             s_container.BorderSizePixel = 0
  459.             s_container.Size = UDim2.new(0.95, 0, 0, 40)
  460.            
  461.             s_title.Text = "   "..title
  462.             s_title.BackgroundTransparency = 1
  463.             s_title.Position = UDim2.new(0,0,0,0)
  464.             s_title.Size = UDim2.new(0.5, 0, 0.8, 0)
  465.             s_title.Font = Enum.Font.SourceSansSemibold
  466.             s_title.TextXAlignment = Enum.TextXAlignment.Left
  467.             s_title.TextColor3 = Color3.fromRGB(255, 255, 255)
  468.             s_title.TextSize = 18
  469.            
  470.             s_button.BackgroundColor3 = Color3.fromRGB(116, 116, 116)
  471.             s_button.BorderSizePixel = 0
  472.             s_button.Size = UDim2.new(1, 0, 0.2, 0)
  473.             s_button.Position = UDim2.new(0, 0, 0.8, 0)
  474.             s_button.ClipsDescendants = true
  475.             s_button.Text = ""
  476.             s_button.AutoButtonColor = false
  477.            
  478.             s_frame.BackgroundColor3 = Color3.fromRGB(177, 177, 177)
  479.             s_frame.BorderSizePixel = 0
  480.             s_frame.Size = UDim2.new(0.5, 0, 0.2, 0)
  481.             s_frame.ZIndex = 2
  482.             s_frame.Position = UDim2.new(0, 0, 0.8, 0)
  483.            
  484.             s_value.BackgroundTransparency = 1
  485.             s_value.Position = UDim2.new(0.5, 0, 0, 0)
  486.             s_value.Size = UDim2.new(0.5, 0, 0.8, 0)
  487.             s_value.Font = Enum.Font.SourceSansSemibold
  488.             s_value.TextColor3 = Color3.fromRGB(255, 255, 255)
  489.             s_value.TextSize = 18
  490.             s_value.Text = tostring(default)
  491.            
  492.             local mouse = game.Players.LocalPlayer:GetMouse()
  493.             local uis = game:GetService("UserInputService")
  494.             local value
  495.            
  496.             local move
  497.             local kill
  498.            
  499.             s_button.MouseButton1Down:Connect(function()
  500.                 s_frame.Size = UDim2.new(0, math.clamp(mouse.X - s_frame.AbsolutePosition.X, 0, s_button.AbsoluteSize.X), 0.2, 0)
  501.                 value = math.floor((((tonumber(max) - tonumber(min)) / s_button.AbsoluteSize.X) * s_frame.AbsoluteSize.X) + tonumber(min))
  502.                 callback(value)
  503.                 s_value.Text = value
  504.                 move = mouse.Move:Connect(function()
  505.                     value = math.floor((((tonumber(max) - tonumber(min)) / s_button.AbsoluteSize.X) * s_frame.AbsoluteSize.X) + tonumber(min))
  506.                     callback(value)
  507.                     s_value.Text = value
  508.                     s_frame.Size = UDim2.new(0, math.clamp(mouse.X - s_frame.AbsolutePosition.X, 0, s_button.AbsoluteSize.X), 0.2, 0)
  509.                 end)
  510.                 kill = uis.InputEnded:Connect(function(Mouse)
  511.                     if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  512.                         value = math.floor((((tonumber(max) - tonumber(min)) / s_button.AbsoluteSize.X) * s_frame.AbsoluteSize.X) + tonumber(min))
  513.                         callback(value)
  514.                         move:Disconnect()
  515.                         kill:Disconnect()
  516.                     end
  517.                 end)
  518.             end)
  519.         end
  520.         return cheats_lib
  521.     end
  522.     return options_lib
  523. end
  524. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement