
KeylessUniversal

print("🟢 AFK + WEBHOOK inicialized")
-- =====================
-- SERVICES
-- =====================
local Players = game:GetService("Players")
local VirtualUser = game:GetService("VirtualUser")
local TextChatService = game:GetService("TextChatService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local HttpService = game:GetService("HttpService")
local GuiService = game:GetService("GuiService")
local player = Players.LocalPlayer
-- =====================
-- CONFIG
-- =====================
local INTERVAL = 600
local HEARTBEAT = 60
local WEBHOOK = " your webhook here"
local req = request or http_request or (syn and syn.request)
-- =====================
-- HELPERS
-- =====================
local function formatTime(sec)
local m = math.floor(sec / 60)
local s = sec % 60
return string.format("%02d:%02d", m, s)
end
-- =====================
-- ANTI IDLE
-- =====================
player.Idled:Connect(function()
VirtualUser:CaptureController()
VirtualUser:ClickButton2(Vector2.new(0,0))
end)
-- =====================
-- PASSINHO
-- =====================
local function tinyStep()
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
hum:Move(Vector3.new(0,0,1), true)
end
-- =====================
-- CHAT AFK
-- =====================
local function sendAFK()
if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
local ch = TextChatService.TextChannels:FindFirstChild("RBXGeneral")
if ch then ch:SendAsync("AFK") end
else
ReplicatedStorage
:WaitForChild("DefaultChatSystemChatEvents")
:WaitForChild("SayMessageRequest")
:FireServer("AFK", "All")
end
end
-- =====================
-- WEBHOOK
-- =====================
local startTime = os.time()
local messageId
local function webhookCreate()
if not req then return end
local res = req({
Url = WEBHOOK .. "?wait=true",
Method = "POST",
Headers = {["Content-Type"] = "application/json"},
Body = HttpService:JSONEncode({
content = "🟢 **AFK FARM ACTIVE**\n⏱️ Tempo: 00:00"
})
})
local body = HttpService:JSONDecode(res.Body)
messageId = body.id
end
local function webhookUpdate()
if not (req and messageId) then return end
local elapsed = os.time() - startTime
req({
Url = WEBHOOK .. "/messages/" .. messageId,
Method = "PATCH",
Headers = {["Content-Type"] = "application/json"},
Body = HttpService:JSONEncode({
content = "🟢 **AFK FARM ACTIVE**\n⏱️ Tempo: " .. formatTime(elapsed)
})
})
end
local function webhookDelete()
if not (req and messageId) then return end
req({
Url = WEBHOOK .. "/messages/" .. messageId,
Method = "DELETE"
})
end
-- =====================
-- START
-- =====================
task.wait(1)
tinyStep()
sendAFK()
webhookCreate()
-- =====================
-- LOOP AFK
-- =====================
task.spawn(function()
while true do
task.wait(INTERVAL)
tinyStep()
sendAFK()
end
end)
-- =====================
-- HEARTBEAT
-- =====================
task.spawn(function()
while true do
task.wait(HEARTBEAT)
print("💓 Anti-Afk Working")
webhookUpdate()
end
end)
-- =====================
-- DESCONEXÃO / FECHAMENTO
-- =====================
local function onShutdown()
print("🔴 Desconected — Cleaning Discord")
webhookDelete()
end
-- erro / kick
GuiService.ErrorMessageChanged:Connect(onShutdown)
-- fechar jogo normal
game:BindToClose(onShutdown)



Despite being made with AI, it is very good and it works very well!
@EmitheYurimewo Thank you, my friend. I don't know anything about coding; I'm just a user of what people who understand code do. As a user, I'd like a good anti-AFK script, so I made one with AI, tested it before sending it here, and I'm glad you liked it. This script is for all of us
nice script
i used for an game event, i got all perks, thank you so much, I went AFK for several hours and it worked perfectly.
@raxixe32 Hey bro, I'm the one who should thank you for using this script, and I'm glad I was able to help you achieve something in your game lol
porque quando eu executei eu tomei ban de 3 anos e invadiram minha maquina?