SALENDRA

Anti afk xeno

Oct 31st, 2025
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. -- Sebs Xeno-style Anti AFK (PC)
  2. -- Jalankan di Xeno executor (PC). Tanpa GUI. Single-exec guard.
  3. if _G.__Sebs_Xeno_AntiAFK then
  4. warn("[Sebs Xeno AntiAFK] Sudah aktif.")
  5. return
  6. end
  7. _G.__Sebs_Xeno_AntiAFK = true
  8.  
  9. local Players = game:GetService("Players")
  10. local RunService = game:GetService("RunService")
  11. local UserInputService = game:GetService("UserInputService")
  12.  
  13. local LocalPlayer = Players.LocalPlayer
  14. if not LocalPlayer then
  15. repeat task.wait() until Players.LocalPlayer
  16. LocalPlayer = Players.LocalPlayer
  17. end
  18.  
  19. -- Try to obtain VirtualUser (preferred on executors like Xeno)
  20. local VirtualUser
  21. pcall(function()
  22. VirtualUser = game:GetService("VirtualUser")
  23. end)
  24.  
  25. -- CONFIG (ubah jika mau)
  26. local INTERVAL = 55 -- detik, interval proaktif (50-55 ideal)
  27. local SHORT_THROTTLE = 0.5 -- throttle internal jangan spamming
  28. local ENABLE_CAMERA_FALLBACK = false -- biasanya tidak perlu di PC Xeno
  29. local CAMERA_NUDGE_ANGLE = 0.35
  30. local CAMERA_NUDGE_TIME = 0.06
  31.  
  32. local running = true
  33. local lastTrigger = 0
  34.  
  35. -- safe vector convert
  36. local function toVec2(v)
  37. if typeof(v) == "Vector3" then return Vector2.new(v.X, v.Y) end
  38. if typeof(v) == "Vector2" then return v end
  39. return Vector2.new(0,0)
  40. end
  41.  
  42. -- camera nudge fallback (very small, optional)
  43. local function nudgeCamera()
  44. if not ENABLE_CAMERA_FALLBACK then return end
  45. local cam = workspace.CurrentCamera
  46. if not cam then return end
  47. local orig = cam.CFrame
  48. local target = orig * CFrame.Angles(0, math.rad(CAMERA_NUDGE_ANGLE), 0)
  49. local t0 = tick()
  50. while tick() - t0 < CAMERA_NUDGE_TIME do
  51. local a = (tick() - t0) / CAMERA_NUDGE_TIME
  52. cam.CFrame = orig:Lerp(target, a)
  53. RunService.RenderStepped:Wait()
  54. end
  55. local t1 = tick()
  56. while tick() - t1 < CAMERA_NUDGE_TIME do
  57. local a = (tick() - t1) / CAMERA_NUDGE_TIME
  58. cam.CFrame = target:Lerp(orig, a)
  59. RunService.RenderStepped:Wait()
  60. end
  61. cam.CFrame = orig
  62. end
  63.  
  64. -- core: do VirtualUser click similar Xeno/Delta
  65. local function doXenoClick()
  66. if not VirtualUser then return false end
  67. local ok = pcall(function()
  68. VirtualUser:CaptureController()
  69. -- Xeno-style commonly uses ClickButton2 (right-click) — attempt it
  70. VirtualUser:ClickButton2(toVec2(Vector2.new(0,0)))
  71. end)
  72. if not ok then
  73. -- fallback to left click / button down-up
  74. pcall(function() VirtualUser:ClickButton1(toVec2(Vector2.new(0,0))) end)
  75. pcall(function() VirtualUser:Button1Down(Vector2.new(0,0)) end)
  76. task.wait(0.03)
  77. pcall(function() VirtualUser:Button1Up(Vector2.new(0,0)) end)
  78. end
  79. return true
  80. end
  81.  
  82. -- main trigger
  83. local function triggerAntiAFK()
  84. if tick() - lastTrigger < SHORT_THROTTLE then return end
  85. lastTrigger = tick()
  86. local done = doXenoClick()
  87. if not done then
  88. -- jika VirtualUser tidak tersedia, coba camera nudge & small simulate mouse
  89. pcall(nudgeCamera)
  90. -- attempt simulated mouse down/up using UserInputService (best-effort)
  91. pcall(function()
  92. -- some executors expose these; harmless if not supported
  93. UserInputService.MouseEnabled = true
  94. end)
  95. end
  96. end
  97.  
  98. -- listen to LocalPlayer.Idled event (Roblox official)
  99. pcall(function()
  100. if LocalPlayer and LocalPlayer.Idled then
  101. LocalPlayer.Idled:Connect(function()
  102. pcall(triggerAntiAFK)
  103. end)
  104. end
  105. end)
  106.  
  107. -- proactive loop
  108. task.spawn(function()
  109. while running do
  110. task.wait(INTERVAL)
  111. if not running then break end
  112. pcall(triggerAntiAFK)
  113. end
  114. end)
  115.  
  116. -- reset lastTrigger on user input (respecting activity)
  117. UserInputService.InputBegan:Connect(function(_, processed)
  118. if not processed then lastTrigger = tick() end
  119. end)
  120. UserInputService.InputChanged:Connect(function(_, processed)
  121. if not processed then lastTrigger = tick() end
  122. end)
  123.  
  124. -- stop function
  125. _G.Sebs_XenoAntiAFK_Stop = function()
  126. running = false
  127. _G.__Sebs_Xeno_AntiAFK = nil
  128. print("[Sebs Xeno AntiAFK] Dihentikan.")
  129. end
  130.  
  131. print("[Sebs Xeno AntiAFK] Aktif ✅ | Interval:", INTERVAL, "detik | VirtualUser:",
  132. (VirtualUser and "TERSEDIA" or "TIDAK TERSEDIA"))
  133.  
Advertisement
Add Comment
Please, Sign In to add comment