Advertisement
A_GUES

op Auto click script

Jun 6th, 2023 (edited)
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.75 KB | None | 0 0
  1. --// Credits \\--
  2. --[[ Ezpi#0474 - Creator of this script ]]--
  3.  
  4. --// Services \\--
  5. local CoreGui = game:GetService("CoreGui")
  6. local Players = game:GetService("Players")
  7. local VirtualInputManager = game:GetService("VirtualInputManager")
  8.  
  9. --// Variables \\--
  10. local Player = Players.LocalPlayer
  11. local Enabled = false
  12. local Mouse = Player:GetMouse()
  13. local X, Y = 0, 0
  14. local LastC = Color3.new(1, 0, 0)
  15. local LastU = tick()
  16.  
  17. --// Exploit Fix \\--
  18. if not pcall(function() return syn.protect_gui end) then
  19.     syn = {}
  20.     syn.protect_gui = function(A_1)
  21.         A_1.Parent = CoreGui
  22.     end
  23. end
  24.  
  25. --// UI Library \\--
  26. local Library = loadstring(game:HttpGetAsync('https://pastebin.com/raw/edJT9EGX'))()
  27. local Window = Library:CreateWindow("AutoClicker by Ezpi")
  28. local Enabled_1 = Window:AddColor({
  29.     text = 'Status:',
  30.     flag = "Ezpi_1",
  31.     color = Color3.new(1, 0, 0),
  32.     callback = function(A_1)
  33.         -- "Enabled" Color
  34.         local NewColor = Color3.new(0, 1, 0)
  35.         if Enabled == false then
  36.             NewColor = Color3.new(1, 0, 0)
  37.         end
  38.         if NewColor ~= LastC or A_1 ~= NewColor then
  39.             LastC = NewColor
  40.             Enabled_1:SetColor(NewColor)
  41.         end
  42.     end
  43. })
  44. local Box_1 = Window:AddBox({
  45.     text = "AutoClick Position:",
  46.     value = "X: " .. X .. ", Y: " .. Y,
  47.     callback = function()
  48.         if tick() - LastU > 0.1 then
  49.             LastU = tick()
  50.             Box_1:SetValue("X: " .. X .. ", Y: " .. Y)
  51.         end
  52.     end
  53. })
  54. local AutoClickerToggle
  55. AutoClickerToggle = Window:AddToggle({
  56.     text = 'Toggle',
  57.     callback = function(value)
  58.         Enabled = value
  59.         -- "Enabled" Color
  60.         local NewColor = Color3.new(0, 1, 0)
  61.         if Enabled == false then
  62.             NewColor = Color3.new(1, 0, 0)
  63.         end
  64.         if NewColor ~= LastC then
  65.             LastC = NewColor
  66.             Enabled_1:SetColor(NewColor)
  67.         end
  68.         -- Click Position
  69.         if Enabled then
  70.             -- Update Mouse Pos
  71.             X, Y = Mouse.X, Mouse.Y + 10
  72.             -- Update Box
  73.             Box_1:SetValue("X: " .. X .. ", Y: " .. Y)
  74.             -- AutoClick
  75.             while Enabled and AutoClickerToggle:GetValue() do
  76.                 VirtualInputManager:SendMouseButtonEvent(X, Y, 0, true, game, 1)
  77.                 VirtualInputManager:SendMouseButtonEvent(X, Y, 0, false, game, 1)
  78.                 wait(Library.flags.Interval)
  79.             end
  80.         else
  81.             X, Y = 0, 0
  82.             Box_1:SetValue("X: " .. X .. ", Y: " .. Y)
  83.         end
  84.     end
  85. })
  86. Window:AddSlider({
  87.     text = 'Interval',
  88.     flag = "Interval",
  89.     min = 0.001,
  90.     max = 2,
  91.     value = 1,
  92.     callback = function(value)
  93.         Library.flags.Interval = value
  94.     end
  95. })
  96. Library:Init()
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement