Perfect AntiAFK
Key RequiredUniversal

Perfect AntiAFK

Universal Scriptneutralneutral 164 views 4K executesUpdated Jul 10, 2026
Unrated
00
Lua Script•27 lines (680 chars)
repeat task.wait() until game:IsLoaded()

local Players = game:GetService("Players")
local VirtualUser = game:GetService("VirtualUser")

local Player = Players.LocalPlayer
while not Player do
	Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
	Player = Players.LocalPlayer
end

if getconnections then
	for _, connection in pairs(getconnections(Player.Idled)) do
		pcall(function()
			if connection["Disable"] then
				connection["Disable"](connection)
			elseif connection["Disconnect"] then
				connection["Disconnect"](connection)
			end
		end)
	end
else
	Player.Idled:Connect(function()
		VirtualUser:CaptureController()
		VirtualUser:ClickButton2(Vector2.new())
	end)
end

Features & Information

This anti-AFK script was made because most other anti-AFK scripts are unnecessarily complicated, with UIs and extra features that are not needed. This one is built to be simple, lightweight, and reliable. Just put it in auto-execute and it will handle the rest. It includes checks to make sure Roblox, Players, and LocalPlayer are loaded before running, which prevents errors caused by the client still starting up.

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts