> For the complete documentation index, see [llms.txt](https://shift-studios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shift-studios.gitbook.io/docs/old-free/editor-10.md). Agents can also search and read this documentation through its [MCP server](https://shift-studios.gitbook.io/docs/~gitbook/mcp).

# No AFK

Transform Your Server With Shift Studios — Powerful, Optimized, And Reliable Resources Built To Improve Every Experience.

<figure><img src="https://4062160621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgqh3gjuJzDAWNXTD9sEE%2Fuploads%2FYVF5VoWkUdWIqpGG1BTh%2Fno%20afk.png?alt=media&amp;token=9847a891-a60c-4977-9652-0ea3e3b75d95" alt=""><figcaption></figcaption></figure>

### Installation

{% stepper %}
{% step %}

### No AFK

Read Everything Below To Install
{% endstep %}

{% step %}

### Ensure All Dependencies Are Installed

```
No Dependencies Needed
```

{% endstep %}

{% step %}

### Drag & Drop

Drag & Drop The Resource Into Your FiveM Server
{% endstep %}

{% step %}

### Ensure The Resource

Make Sure To Ensure shift-noafk In Your Server CFG.
{% endstep %}

{% step %}

### Configure The Resource

{% code expandable="true" %}

```lua
-- 💠 ███████╗██╗  ██╗██╗███████╗████████╗    ███████╗████████╗██╗   ██╗██████╗ ██╗ ██████╗ ███████╗ 💠
-- 🔷 ██╔════╝██║  ██║██║██╔════╝╚══██╔══╝    ██╔════╝╚══██╔══╝██║   ██║██╔══██╗██║██╔═══██╗██╔════╝ 🔷
-- 🌀 ███████╗███████║██║█████╗     ██║       ███████╗   ██║   ██║   ██║██║  ██║██║██║   ██║███████╗ 🌀
-- 🔹 ╚════██║██╔══██║██║██╔══╝     ██║       ╚════██║   ██║   ██║   ██║██║  ██║██║██║   ██║╚════██║ 🔹
-- 💎 ███████║██║  ██║██║██║        ██║       ███████║   ██║   ╚██████╔╝██████╔╝██║╚██████╔╝███████║ 💎
-- 🔵 ╚══════╝╚═╝  ╚═╝╚═╝╚═╝        ╚═╝       ╚══════╝   ╚═╝    ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ 🔵

Config = {}

-- Framework: 'auto', 'esx', 'qb', 'qbox', or 'standalone'.
-- Auto detects qbx_core, qb-core, or es_extended. The AFK core itself is standalone.
Config.Framework = 'auto'

-- Time in seconds before the player is kicked.
Config.AFKTime = 300

-- How many seconds before the kick to show the AFK warning.
Config.WarningTime = 120

Config.KickReason = 'You Were Kicked For Being AFK.'

-- How often activity is checked. Lower values react faster but run more often.
Config.ActivityCheckInterval = 500
Config.TimerCheckInterval = 1000

-- Analog movement/look deadzone used for keyboard/controller input checks.
Config.InputDeadzone = 0.08

-- Moving farther than this distance also counts as activity.
Config.MovementDistance = 0.15

-- Controls that count as activity in addition to movement/look axes.
-- Add/remove GTA control IDs as needed.
Config.ActivityControls = {
    24,  -- Attack
    25,  -- Aim
    38,  -- Context / E
    44,  -- Cover / Q
    45,  -- Reload / R
    46,  -- Talk / E alternative contexts
    47,  -- Detonate / G
    75,  -- Exit vehicle / F
    76,  -- Vehicle handbrake
    86,  -- Vehicle horn
    140, -- Melee light attack
    141, -- Melee heavy attack
    142, -- Melee alternate attack
    200, -- Pause / ESC
    245  -- Chat / T
}

-- Treat being inside the pause menu as activity so players are not kicked while using it.
Config.PauseMenuCountsAsActivity = true

-- Optional ACE bypass.
Config.AceBypass = {
    Enabled = false,
    Permission = 'shift-noafk.bypass'
}

-- Job whitelist. Whitelisted players are checked server-side when the kick is requested.
-- With QBCore/Qbox, RequireOnDuty uses job.onduty when available.
-- Standard ESX does not have a universal duty flag, so matching jobs are treated as active duty.
Config.JobWhitelist = {
    Enabled = true,
    RequireOnDuty = true,
    Jobs = {
        police = true,
        ambulance = true
    }
}

-- Notification provider:
-- 'auto', 'ox_lib', 'qbox', 'qb', 'esx', 'native', or 'custom'.
Config.Notifications = {
    Provider = 'ox_lib',

    -- Used when Provider = 'auto'. First available resource wins.
    AutoPriority = {
        'ox_lib',
        'qbx_core',
        'qb-core',
        'es_extended',
        'native'
    },

    Warning = {
        title = 'AFK Warning',
        description = 'Move or interact before you are kicked for being AFK.',
        type = 'warning',
        duration = 8000,
        position = 'center-left',
        icon = 'clock'
    },

    -- Used only when Provider = 'custom'.
    -- Type can be 'event' or 'export'.
    Custom = {
        Type = 'event',
        Event = '',
        Resource = '',
        Export = ''
    }
}

-- Console debug messages.
Config.Debug = false

```

{% endcode %}
{% endstep %}

{% step %}

### Restart / Start Your Server

Ensure Everything Is Working Well & Enjoy !!
{% endstep %}
{% endstepper %}
