# Configuration

This configuration file allows you to set up different security units, their behavior, appearance, and interaction with other in-game elements.

***

### General Settings

#### Framework

```lua
Config.framework = "QB" -- QB or ESX
```

Specify the game framework being used: `QB` or `ESX`.

#### Language

```lua
Config.language = English
```

Set the language used in menus and notifications. Default: `English`.

#### Debug Mode

```lua
Config.debug = false
```

Enable or disable console debugging. Set to `true` for development purposes.

***

### Security Codes

Define various security units, their behavior, appearance, and capabilities.

#### Example Security Code: Bodyguards

```lua
{
    name = "BODYGUARDS",
    car = "washington",
    outfit = "BODYGUARDS",
    useCustomModel = true,
    customModel = "s_m_m_bouncer_01",
    weaponDriver = "weapon_knuckle",
    weaponPassenger = "weapon_knuckle",
    health = 200,
    precision = 75,
    drivingSpeed = 50.0,
    combatStyle = 'defensive',
    description = "Close Protection Specialists",
}
```

**Attributes:**

* `name`: Identifier for the security unit.
* `car`: Vehicle model used by the unit.
* `outfit`: Outfit configuration for NPCs (see Outfit Configurations).
* `useCustomModel`: Whether a custom NPC model is used.
* `customModel`: Model identifier for NPCs (used if `useCustomModel` is `true`).
* `weaponDriver` and `weaponPassenger`: Weapons assigned to driver and passenger NPCs.
* `health`: NPC health points.
* `precision`: Shooting precision (0–100).
* `drivingSpeed`: Vehicle driving speed.
* `combatStyle`: Combat behavior: `defensive` or `offensive`.
* `description`: Description of the security unit.

#### Predefined Security Codes

1. **Bodyguards**: Close protection specialists.
2. **Security Agents**: Personal security agents.
3. **Mercenaries**: Armed and aggressive escorts.
4. **VIP Escort**: High-profile protection service.

***

### Key Bindings

#### Open Menu

```lua
Config.openMenu = "PAGEDOWN"
```

Defines the key binding to open the security menu (`/security` command).

***

### Permissions and Roles

#### Security Job Requirement

```lua
Config.securityJob = "police"
```

Specify the required job to add security access using the `/addsecurity` command.&#x20;

For more information about how commands work, Check this [page](/documentations/fivem-scripts/ai-guards/security-system-commands.md).

#### Admin Groups

```lua
Config.adminGroups = {'command', 'admin', 'god'}
```

Define admin groups with special permissions.

***

### NPC Behavior Settings

#### Police Interaction

```lua
Config.securityRespectPolice = false
```

Determines whether NPC security avoids engaging with the police.

#### Cooldown Timer

```lua
Config.cooldownTime = 35
```

Cooldown (in seconds) before another security unit can be called after canceling a request.

#### Headshot Protection

```lua
Config.sufferHeadshot = false
```

Enable or disable headshot damage for NPC security units.

#### Ragdoll Effect

```lua
Config.ragdoll = false
```

Enable or disable NPCs' ability to ragdoll when pushed or shot.

#### Driving Style

```lua
Config.customDrivingStyle = 0
```

Set the NPC driver's driving style. Default: `0` (best driving style for this script).

#### Spawn Distance

```lua
Config.maxSpawnDistance = 180
```

Maximum spawn distance for security units. Range: 20–180.

#### Formation Behavior

```lua
Config.backupDefaultFormation = 0
```

Define the default formation for NPC security:

* `0`: Free movement.
* `1`: Circle around leader (look in).
* `2`: Circle around leader (look out).
* `3`: Line (leader at the center).
* `4`: Line follow formation.

***

### Weapons Blacklist

Specify weapons that won't trigger security engagement.

```lua
Config.nonBackupNeededWeapons = {
    "WEAPON_Grenade",
    "WEAPON_Molotov",
    "WEAPON_Snowball",
    -- Add more as needed
}
```

***

### Outfit Configurations

Define clothing and gear for NPC security personnel.

#### Example Outfit: Bodyguards

```lua
["BODYGUARDS"] = {
    clothing = {
        MASK = { clothingItem = -1, textureId = 0 },
        ACCESSORIES = { clothingItem = -1, textureId = 0 },
        UPPER = { clothingItem = 4, textureId = 0 },
        LOWER = { clothingItem = 13, textureId = 0 },
        SHOES = { clothingItem = 21, textureId = 0 },
        JACKET = {
            { clothingItem = 111, textureId = 0 },
            { clothingItem = 111, textureId = 2 },
        }
    },
    gear = {
        HAT = {
            { clothingItem = -1, textureId = 0 },
        },
        GLASSES = {
            { clothingItem = -1, textureId = 0 },
        },
        EARS = { clothingItem = -1, textureId = 0 },
    }
}
```

**Clothing Attributes:**

* `MASK`, `ACCESSORIES`, `UPPER`, etc.: Define each clothing category.
* `clothingItem`: Item ID.
* `textureId`: Texture variation.

**Gear Attributes:**

* `HAT`, `GLASSES`, `EARS`: Define gear items randomly assigned to NPCs.

***

### Notes

For advanced configurations, modify the editable files in accordance with your server's requirements.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enyo-scripts.gitbook.io/documentations/fivem-scripts/ai-guards/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
