Created
May 1, 2026 16:39
-
-
Save DuyNgao2306/a7172589f96b6f7e8c303a9c093e5f8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Anti AFK Script (LocalScript) | |
| local Players = game:GetService("Players") | |
| local VirtualUser = game:GetService("VirtualUser") | |
| local player = Players.LocalPlayer | |
| -- đảm bảo player đã load | |
| if not player then | |
| Players:GetPropertyChangedSignal("LocalPlayer"):Wait() | |
| player = Players.LocalPlayer | |
| end | |
| -- chống bị kick AFK | |
| player.Idled:Connect(function() | |
| -- giả lập tương tác người dùng | |
| VirtualUser:CaptureController() | |
| VirtualUser:ClickButton2(Vector2.new(0, 0)) | |
| end) | |
| -- giữ script luôn chạy | |
| while true do | |
| task.wait(60) -- mỗi 60s kiểm tra 1 lần | |
| if player then | |
| -- có thể thêm debug nếu cần | |
| -- print("Anti-AFK đang hoạt động") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment