Akira AFK System

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

  1. 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)

3. Add the LocalScript

  1. 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

  1. Insert the Script into ServerScriptService.
    • This script will handle the remote event (SimulateActivity) to keep the player from being kicked due to inactivity.

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

  1. In Roblox Studio, run the game in Play mode.
  2. The AFK button will appear in the player’s GUI. Clicking the button will toggle the AFK state.
  3. If the player remains inactive for more than 5 minutes, the AFK state will automatically be enabled.
  4. The AFK tag will appear above the player’s head when they are AFK.
  5. 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’s MouseButton1Click event is connected properly.
  • Player gets kicked despite AFK system: Verify that the SimulateActivity RemoteEvent is being fired every 30 seconds.

Testing this in studio isnt a good idea because a studio playsession never times out