Simple Anti Afk
Key RequiredUniversal

Simple Anti Afk

Universal ScriptH7O_H7O_ 822 views 22.8K executesUpdated Mar 4, 2026
4.3/ 5(7 votes)
6186% Positive
Lua Script•52 lines (1493 chars)
local Players = game:GetService("Players")
local player = Players.LocalPlayer

if player:WaitForChild("PlayerGui"):FindFirstChild("AntiAFKGui") then
	player.PlayerGui.AntiAFKGui:Destroy()
end

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "AntiAFKGui"
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = player:WaitForChild("PlayerGui")

local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 200, 0, 100)
Frame.Position = UDim2.new(0.5, -100, 0.5, -50)
Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Frame.Active = true
Frame.Draggable = true
Frame.Parent = ScreenGui

local ToggleButton = Instance.new("TextButton")
ToggleButton.Size = UDim2.new(1, -20, 0, 50)
ToggleButton.Position = UDim2.new(0, 10, 0, 25)
ToggleButton.Text = "Anti AFK: OFF"
ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
ToggleButton.TextColor3 = Color3.new(1,1,1)
ToggleButton.Parent = Frame

local antiAFK = false

task.spawn(function()
	while true do
		if antiAFK then
			local character = player.Character
			if character and character:FindFirstChild("Humanoid") then
				character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
			end
		end
		task.wait(1)
	end
end)

ToggleButton.MouseButton1Click:Connect(function()
	antiAFK = not antiAFK
	if antiAFK then
		ToggleButton.Text = "Anti AFK: ON"
		ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50)
	else
		ToggleButton.Text = "Anti AFK: OFF"
		ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
	end
end)

Features & Information

jumps every second so u don't disconnect.
#anti#afk#antiafk#anti afk

Community Comments (3)

H7O_H7O_Mar 4, 2026

who disliked :(

kouisanzkouisanzMar 13, 2026

w

Replying to @kouisanz
H7O_H7O_Mar 13, 2026

@kouisanz glad u like it!

More Scripts for Universal Scripts