Advertisement
Sun_Wukong

ROBLOX Autoclicker

Mar 21st, 2022 (edited)
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.21 KB | None | 0 0
  1. local on
  2. local keybind=Enum.KeyCode.F5
  3. local keybindEnd=Enum.KeyCode.F6
  4. local UserInputService=game:GetService("UserInputService")
  5. local RunService=game:GetService("RunService")
  6. local plr=game:GetService("Players").LocalPlayer
  7. local mouse=plr:GetMouse()
  8.  
  9. local sg=Instance.new("ScreenGui",plr.PlayerGui)
  10. local f=Instance.new("TextLabel",sg)
  11. f.Size=UDim2.new(0,25,0,10)
  12. f.BackgroundColor3=Color3.fromRGB(180,50,50)
  13. f.Visible=false
  14. f.Text="On"
  15. f.TextSize=11
  16.  
  17. local vu = game:GetService("VirtualUser")
  18. local function CC()
  19. vu:CaptureController();
  20. end
  21. local function CB()
  22. local v2 = Vector2.new();
  23. vu:ClickButton1(v2);
  24. end
  25.  
  26. function Start(a,b)
  27.    if a.KeyCode==keybind then
  28.        on=true
  29.        a=RunService.Stepped:Connect(function()
  30.            if on then
  31.                CC();
  32.                CB();
  33.                f.Visible=true
  34.                f.Position=UDim2.new(0,mouse.X-12.5,0,mouse.Y-15)
  35.            else
  36.                a:Disconnect()
  37.            end
  38.        end)
  39.        f.Visible=false
  40.    end
  41. end
  42.  
  43. function Stop(a,b)
  44.    if a.KeyCode==keybindEnd then
  45.        on=false
  46.        f.Visible=false
  47.    end
  48. end
  49.  
  50. UserInputService.InputBegan:connect(Start)
  51. UserInputService.InputEnded:connect(Stop)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement