Akira AFK System
This repository provides an AFK system that prevents players from being kicked for inactivity and allows players to manually toggle their AFK status. It also adds an AFK tag above the player’s head to visually indicate whether they are AFK. [ I was feeling bored so I made this. Enjoy! ]
Features
- Prevents AFK kick by simulating player activity every 30 seconds.
- Allows players to manually toggle their AFK status with a UI button.
- Displays an AFK tag above the player’s head when they are AFK.
- Updates the UI button with a green “AFK” or red “Not AFK” based on the player’s status.
Setup Instructions
Follow these steps to set up the AFK system in your Roblox game.
1. Download the Project
Akira AFK System.rbxm (14.4 KB)
2. Set Up the ReplicatedStorage
-
ReplicatedStorage:
- Create a
ReplicatedStorage
folder if it does not already exist. - Inside
ReplicatedStorage
, create the following objects:- SimulateActivity (RemoteEvent): Used to simulate player activity every 30 seconds.
- AFKTag (BillboardGui): A template for the AFK tag that will be placed above the player’s head when they are AFK.
The AFKTag should look like this:
-
AFKTag (BillboardGui)
-
Frame (Frame)
- AFKTagText (TextLabel)
-
Frame (Frame)
- Create a
3. Add the LocalScript
-
Insert the
LocalScript
into a ScreenGui or a suitable UI component within the player’s GUI.- This script controls the UI and AFK logic for the player.
4. Add the Script to Handle AFK Simulation
-
Insert the
Script
into ServerScriptService.- This script will handle the remote event (
SimulateActivity
) to keep the player from being kicked due to inactivity.
- This script will handle the remote event (
5. Customize the UI
- You can customize the AFK button’s appearance, text, and layout by modifying the
LocalScript
and the button inside your UI. - The AFKTag (BillboardGui) can also be customized to fit your game’s theme.
6. Test the AFK System
- In Roblox Studio, run the game in Play mode.
- The AFK button will appear in the player’s GUI. Clicking the button will toggle the AFK state.
- If the player remains inactive for more than 5 minutes, the AFK state will automatically be enabled.
- The AFK tag will appear above the player’s head when they are AFK.
- The system will prevent the player from being kicked for inactivity.
Troubleshooting
- AFK tag is not appearing: Ensure the AFKTag template in ReplicatedStorage has the correct setup (BillboardGui and child objects like Frame and TextLabel).
-
Button click does not toggle AFK: Ensure the
LocalScript
is correctly inserted into a ScreenGui and that the button’sMouseButton1Click
event is connected properly. -
Player gets kicked despite AFK system: Verify that the
SimulateActivity
RemoteEvent is being fired every 30 seconds.