# Headshot System

### Table of Contents

* Config.Enabled
* Config.AnimationEnabled
* Config.AnimationType
* Config.RagdollDuration
* Config.CameraShake
* Config.HeadshotSound
* Config.KillerEffect
* Config.KillerScreenColor
* Config.KillerScreenOpacity
* Config.KillerEffectDuration
* Config.KillerEffectFade
* Config.HeadBones
* Config.Animations
* Config.Colors

***

### ⚙️ Main Settings

#### `Config.Enabled`

**Type:** `boolean`\
**Default:** `true`

Enables or disables the entire system.

```lua
Config.Enabled = true
```

***

### 🎬 Animation Settings

#### `Config.AnimationEnabled`

**Type:** `boolean`\
**Default:** `false`

Enables animation playback on headshot.

```lua
Config.AnimationEnabled = false
```

***

#### `Config.AnimationType`

**Type:** `string`\
**Default:** `"ragdoll_front"`

Selects the animation type triggered on headshot. Must match a key inside `Config.Animations`.

**Available values:**

* `ragdoll_front`
* `ragdoll_back`
* `fall_front`
* `fall_back`
* `fall_side`

```lua
Config.AnimationType = "ragdoll_front"
```

***

#### `Config.RagdollDuration`

**Type:** `number` (milliseconds)\
**Default:** `1500`

Duration of the ragdoll effect after the headshot.

```lua
Config.RagdollDuration = 1500
```

***

#### `Config.CameraShake`

**Type:** `boolean`\
**Default:** `false`

Triggers a camera shake effect on the victim at the moment of impact.

```lua
Config.CameraShake = false
```

***

#### `Config.HeadshotSound`

**Type:** `boolean`\
**Default:** `false`

Plays a sound effect when a headshot is registered.

```lua
Config.HeadshotSound = false
```

***

### 🎯 Killer Effect Settings

#### `Config.KillerEffect`

**Type:** `boolean`\
**Default:** `false`

Enables a screen flash effect on the killer's screen after a successful headshot.

```lua
Config.KillerEffect = false
```

***

#### `Config.KillerScreenColor`

**Type:** `string`\
**Default:** `"black"`

Color of the screen flash effect. Must match a key inside `Config.Colors`.

**Available values:**

* `black`
* `red`
* `white`
* `blue`
* `green`

```lua
Config.KillerScreenColor = "black"
```

***

#### `Config.KillerScreenOpacity`

**Type:** `number` (0–255)\
**Default:** `50`

Opacity level of the screen flash effect.

```lua
Config.KillerScreenOpacity = 50
```

***

#### `Config.KillerEffectDuration`

**Type:** `number` (milliseconds)\
**Default:** `400`

Duration the killer's screen effect remains visible.

```lua
Config.KillerEffectDuration = 400
```

***

#### `Config.KillerEffectFade`

**Type:** `boolean`\
**Default:** `false`

Enables a smooth fade-out transition when the killer effect ends.

```lua
Config.KillerEffectFade = false
```

***

### 🦴 Head Bones

#### `Config.HeadBones`

**Type:** `table`

List of bone IDs detected as a headshot. Any damage on these bones is treated as a critical hit.

```lua
Config.HeadBones = {
    [52301] = true,
    [14201] = true,
    [31086] = true,
    [39317] = true
}
```

| Bone ID | Description |
| ------- | ----------- |
| `52301` | Head        |
| `14201` | Skull       |
| `31086` | Forehead    |
| `39317` | Neck        |

***

### 🎭 Animations

#### `Config.Animations`

**Type:** `table`

Defines all available animations. Each entry contains an animation dictionary (`dict`) and an animation name (`anim`).

```lua
Config.Animations = {
    ["ragdoll_front"] = {dict = "", anim = ""},
    ["ragdoll_back"]  = {dict = "", anim = ""},
    ["fall_front"]    = {dict = "dam_ko", anim = "ko_fall_front"},
    ["fall_back"]     = {dict = "dam_ko", anim = "ko_fall_back"},
    ["fall_side"]     = {dict = "missarmenian2", anim = "corpse_search_exit_ped"},
}
```

| Key             | Dictionary      | Animation                |
| --------------- | --------------- | ------------------------ |
| `ragdoll_front` | —               | Native ragdoll (front)   |
| `ragdoll_back`  | —               | Native ragdoll (back)    |
| `fall_front`    | `dam_ko`        | `ko_fall_front`          |
| `fall_back`     | `dam_ko`        | `ko_fall_back`           |
| `fall_side`     | `missarmenian2` | `corpse_search_exit_ped` |

> You can add custom animations by inserting new entries with valid `dict` and `anim` values.

***

### 🎨 Colors

#### `Config.Colors`

**Type:** `table`

Defines all available colors used by `Config.KillerScreenColor`. Each color is set in RGB format.

```lua
Config.Colors = {
    ["black"] = {r = 0,   g = 0,   b = 0},
    ["red"]   = {r = 150, g = 0,   b = 0},
    ["white"] = {r = 255, g = 255, b = 255},
    ["blue"]  = {r = 0,   g = 0,   b = 150},
    ["green"] = {r = 0,   g = 150, b = 0},
}
```

| Color   | R   | G   | B   |
| ------- | --- | --- | --- |
| `black` | 0   | 0   | 0   |
| `red`   | 150 | 0   | 0   |
| `white` | 255 | 255 | 255 |
| `blue`  | 0   | 0   | 150 |
| `green` | 0   | 150 | 0   |

> You can add new colors by inserting new entries following the same RGB format.

***

### 📌 Notes

* All durations are in **milliseconds** (`1000ms = 1s`).
* Opacity values must stay within the **0–255** range.
* Animation keys in `Config.AnimationType` must exactly match the keys defined in `Config.Animations`.
* Color keys in `Config.KillerScreenColor` must exactly match the keys defined in `Config.Colors`.


---

# 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://x8project.gitbook.io/x8project/projects/one-tab/headshot-system.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.
