Advertisement
Unnamedbaconplayer

ANTIAFK

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