Universal Script 📌
1.1k Views
3.4k Executions

Anti afk

Universal Script 📌
ZeroVzDev
ZeroVzDevPublished 10
7 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Anti afk script ---open source----

View Raw
local Players = game:GetService("Players")
local VirtualUser = game:GetService("VirtualUser")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local LocalPlayer = Players.LocalPlayer
local cooldown = 0
local interval = 55
local enabled = true
local totalPings = 0
local sessionTime = 0

-- Bypass Roblox idle detection
LocalPlayer.Idled:Connect(function()
    VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
    task.wait(0.1)
    VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
end)

RunService.Heartbeat:Connect(function(dt)
    if not enabled then return end

    cooldown -= dt
    sessionTime += dt

    if cooldown <= 0 then
        cooldown = interval

        -- Method 1: VirtualUser click
        pcall(function()
            VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
            task.wait(0.1)
            VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame)
        end)

        -- Method 2: Camera CFrame nudge
        pcall(function()
            local cam = workspace.CurrentCamera
            local cf = cam.CFrame
            cam.CFrame = cf * CFrame.Angles(0, 0.0001, 0)


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Universal Script 📌
3.9k
185.5k
Bumped 6 hours ago
Script hub
582
48
7 hours ago
Universal Script 📌
28.8k
673.9k
Bumped 9 hours ago
Script hub
14.0k
2.7k
Bumped 11 hours ago
Key System
Paid
Script hub
263.9k
88.5k
Bumped 12 hours ago
Key System
Universal Script 📌
3.1k
10.5k
Bumped 12 hours ago
Universal Script 📌
789
47
Approved 13 hours ago