Installation

How to install tAFK, grant admin access, and confirm the resource is running.

Setup

Prerequisites

  • FiveM server with OneSync enabled (Infinity or Legacy)
  • tLib — install the release zip, not the source code (source lacks built files). tAFK depends on it for Discovery, KVP, dialogs, toasts, and admin ACE
  • Lua 5.4 (the manifest already declares lua54 'yes')

Replaces tommys-afk

tAFK is the successor to the older tommys-afk script. If you had that installed, remove it before starting tAFK — the resource name, exports, and state-changed event are all different (tafk:stateChanged instead of tommys-afk:stateChanged).


Install

Extract the resource

Drop the tAFK folder into your server's resources directory. If you group resources (e.g., [tScripts]), place it alongside them.

Start tLib before tAFK

Order matters — tAFK resolves tLib exports and Discovery at load time.

server.cfg
ensure tLib
ensure tAFK

Grant admin access

The editor, global settings, sequence management, and music-track registration all require tLib's admin ACE. Add it to any group that should be able to author sequences or tune server-wide defaults:

server.cfg
add_ace group.admin tlib.admin allow

Admins can:

  • Open /tafkedit (or the Open Sequence Editor button in /tafk, visible when in a vehicle)
  • Manage sequences — list, enable/disable, create, edit, delete — all inside the editor overlay
  • Adjust global settings via Server Defaults (idle timeout, duration bounds, beat anchor, music defaults)

Non-admins see only the player-facing section of /tafk — their own overrides, sequence opt-outs, and a toggle button.

Start the server

On first run tAFK creates data.json at the resource root, seeded with 11 default sequences and 5 bundled music tracks. No further setup is required.


Quick start: see it in action

Goal: get the camera orbiting your vehicle in under a minute.

Spawn a vehicle

Any vehicle — AFK works on cars, bikes, boats, aircraft.

Stop moving

Sit still. After 30 seconds of no input (movement, mouse, keys), tAFK fades out and drops into the first sequence.

Or trigger it manually

Type /afk to skip the timer. The same fade → cinematic sequence plays immediately.

Hit any input to exit

Any key, mouse move, gamepad stick — instant cancel, fade back to gameplay.

From here, see:

  • Usage guide — all commands, the /tafk dialog, state-bag integration
  • Editor guide — author your own camera sequences in-game
  • Configurationdata.json schema, per-vehicle packs, admin options

File layout

fxmanifest.lua
data.json
cl_bridge.lua
cl_prefs.lua
cl_music.lua
cl_director.lua
cl_camera.lua
cl_detector.lua
cl_commands.lua
cl_editor.lua
cl_settings.lua
PathPurpose
fxmanifest.luaResource manifest — declares tLib dependency and the tafk_config Discovery metadata key
data.jsonSettings, sequences, music tracks, vehicleConfigs (auto-generated)
shared/utils.luaLog helper, camera math, tafkToVec3 decoder
shared/schema.luaDefault settings + sequences + validators
server/sv_store.luadata.json read/write with read-merge-write to coexist with Discovery
server/sv_discovery.luatLib Discovery instance for tafk_configvehicleConfigs section
server/sv_admin.luaACE-gated event handlers (save, toggle, register track, etc.)
client/cl_bridge.luaReceives server config + vehicle configs, exposes merged getters
client/cl_camera.luaAFK lifecycle, camera render, state-bag broadcast
client/cl_director.luaWeighted sequence selection with raycast penalties
client/cl_detector.luaIdle detection, exit conditions, auto-AFK timer
client/cl_music.luaNUI music bridge + beat-data callback
client/cl_editor.luaOrbit-camera keyframe editor + NUI callbacks
client/cl_settings.lua/tafk dialog (player prefs + admin sub-dialogs)
client/ui/Built NUI assets (do not edit)
client/web/NUI source (SolidJS + Vite + UnoCSS)
audio/Music tracks (.ogg/.mp3/.wav)

Do not edit `client/ui/`

These are built NUI assets. Source for the editor HUD and music player lives in client/web/. Build with bun run build from client/web/.


Verifying the install

After starting the server, look for this in the console:

[tAFK] loaded: 11 sequences, 5 music tracks discovered, v1

(Music-tracks count reflects .ogg/.mp3/.wav files discovered in tAFK/audio/ — either name-matched by pattern or listed in audio/manifest.txt. See Configuration → Music tracks.)

On the client, after resource start:

[tAFK] cinematic camera system loaded
[tAFK] config received: 11 sequences, 5 tracks

If the player has the tafk:enabled KVP flag set (from a previous /tafk toggle), you'll also see:

[tAFK] AFK disabled by player preference

That's the normal path for a player who previously opted out.

On this page

Need help?

Ask on Discord