Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Sebs Xeno-style Anti AFK (PC)
- -- Jalankan di Xeno executor (PC). Tanpa GUI. Single-exec guard.
- if _G.__Sebs_Xeno_AntiAFK then
- warn("[Sebs Xeno AntiAFK] Sudah aktif.")
- return
- end
- _G.__Sebs_Xeno_AntiAFK = true
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- if not LocalPlayer then
- repeat task.wait() until Players.LocalPlayer
- LocalPlayer = Players.LocalPlayer
- end
- -- Try to obtain VirtualUser (preferred on executors like Xeno)
- local VirtualUser
- pcall(function()
- VirtualUser = game:GetService("VirtualUser")
- end)
- -- CONFIG (ubah jika mau)
- local INTERVAL = 55 -- detik, interval proaktif (50-55 ideal)
- local SHORT_THROTTLE = 0.5 -- throttle internal jangan spamming
- local ENABLE_CAMERA_FALLBACK = false -- biasanya tidak perlu di PC Xeno
- local CAMERA_NUDGE_ANGLE = 0.35
- local CAMERA_NUDGE_TIME = 0.06
- local running = true
- local lastTrigger = 0
- -- safe vector convert
- local function toVec2(v)
- if typeof(v) == "Vector3" then return Vector2.new(v.X, v.Y) end
- if typeof(v) == "Vector2" then return v end
- return Vector2.new(0,0)
- end
- -- camera nudge fallback (very small, optional)
- local function nudgeCamera()
- if not ENABLE_CAMERA_FALLBACK then return end
- local cam = workspace.CurrentCamera
- if not cam then return end
- local orig = cam.CFrame
- local target = orig * CFrame.Angles(0, math.rad(CAMERA_NUDGE_ANGLE), 0)
- local t0 = tick()
- while tick() - t0 < CAMERA_NUDGE_TIME do
- local a = (tick() - t0) / CAMERA_NUDGE_TIME
- cam.CFrame = orig:Lerp(target, a)
- RunService.RenderStepped:Wait()
- end
- local t1 = tick()
- while tick() - t1 < CAMERA_NUDGE_TIME do
- local a = (tick() - t1) / CAMERA_NUDGE_TIME
- cam.CFrame = target:Lerp(orig, a)
- RunService.RenderStepped:Wait()
- end
- cam.CFrame = orig
- end
- -- core: do VirtualUser click similar Xeno/Delta
- local function doXenoClick()
- if not VirtualUser then return false end
- local ok = pcall(function()
- VirtualUser:CaptureController()
- -- Xeno-style commonly uses ClickButton2 (right-click) — attempt it
- VirtualUser:ClickButton2(toVec2(Vector2.new(0,0)))
- end)
- if not ok then
- -- fallback to left click / button down-up
- pcall(function() VirtualUser:ClickButton1(toVec2(Vector2.new(0,0))) end)
- pcall(function() VirtualUser:Button1Down(Vector2.new(0,0)) end)
- task.wait(0.03)
- pcall(function() VirtualUser:Button1Up(Vector2.new(0,0)) end)
- end
- return true
- end
- -- main trigger
- local function triggerAntiAFK()
- if tick() - lastTrigger < SHORT_THROTTLE then return end
- lastTrigger = tick()
- local done = doXenoClick()
- if not done then
- -- jika VirtualUser tidak tersedia, coba camera nudge & small simulate mouse
- pcall(nudgeCamera)
- -- attempt simulated mouse down/up using UserInputService (best-effort)
- pcall(function()
- -- some executors expose these; harmless if not supported
- UserInputService.MouseEnabled = true
- end)
- end
- end
- -- listen to LocalPlayer.Idled event (Roblox official)
- pcall(function()
- if LocalPlayer and LocalPlayer.Idled then
- LocalPlayer.Idled:Connect(function()
- pcall(triggerAntiAFK)
- end)
- end
- end)
- -- proactive loop
- task.spawn(function()
- while running do
- task.wait(INTERVAL)
- if not running then break end
- pcall(triggerAntiAFK)
- end
- end)
- -- reset lastTrigger on user input (respecting activity)
- UserInputService.InputBegan:Connect(function(_, processed)
- if not processed then lastTrigger = tick() end
- end)
- UserInputService.InputChanged:Connect(function(_, processed)
- if not processed then lastTrigger = tick() end
- end)
- -- stop function
- _G.Sebs_XenoAntiAFK_Stop = function()
- running = false
- _G.__Sebs_Xeno_AntiAFK = nil
- print("[Sebs Xeno AntiAFK] Dihentikan.")
- end
- print("[Sebs Xeno AntiAFK] Aktif ✅ | Interval:", INTERVAL, "detik | VirtualUser:",
- (VirtualUser and "TERSEDIA" or "TIDAK TERSEDIA"))
Advertisement
Add Comment
Please, Sign In to add comment