> For the complete documentation index, see [llms.txt](https://docs.kojascripts.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kojascripts.eu/new/shops/configuration/target.md).

# Target

The `Config.Target` section in the configuration file determines whether your server will use an external target system for NPC interactions (like `ox_target`), or fall back to the default method of displaying text over NPCs. Here's a breakdown of how this works:

**1. Target Enabled (`Config.Target.enabled = true`)**

When the `enabled` property is set to `true`, the server will rely on the external target system (in this case, `ox_target`). This means that NPC interactions will be handled by `ox_target`, and the user will need to use the target system's functionality to interact with NPCs.

* **Target Resource**: The `resource` field indicates which resource to use for the target system. In this example, it's set to `"ox_target"`, meaning it will use the `ox_target` resource to handle NPC interaction.

{% code title="shared/config.lua" %}

```lua
Config.Target = {
    enabled = false,
    resource = "ox_target",
}
```

{% endcode %}

* **Behavior**:
  * The NPC will have a dynamic interaction, and you will use the target system to interact with the NPC (e.g., a circle or indicator will appear around the NPC, and the player will click on the target to initiate interaction).
  * This method provides a more polished and integrated experience for NPC interactions.

**2. Target Disabled (`Config.Target.enabled = false`)**

When the `enabled` property is set to `false`, the server does **not** use any external target system, and the default interaction method is used. In this case, the NPC will show a **text label** above its head (such as "\[E] - Supermarket 24/7"), and players can press the configured key (e.g., \[E]) to interact with the NPC.

* **DrawText**: With `enabled = false`, the NPC interaction is based on a simple **text prompt** that appears above the NPC, usually controlled via `DrawText` or similar functions. This text will display the interaction key (e.g., `[E] - Supermarket 24/7`), instructing the player to press the corresponding button to interact.

  Example:

{% code title="shared/config.lua" %}

```lua
npc = {
    name = "Mark",
    hash = 0x18CE57D0,  -- Hash of the NPC model
    scenario = "WORLD_HUMAN_CLIPBOARD",  -- Scenario/animation for the NPC
    target = {
        icon = "fas fa-shopping-basket",  -- The icon to show with the target interaction (for ox_target)
        label = "[E] - Supermarket 24/7",  -- The label that will be shown over the NPC
        distance = 2.0,  -- Distance within which the interaction is possible
        key = 38,  -- The key used for interaction (38 corresponds to the [E] key)
    }
}
```

{% endcode %}

**Behavior**:

* When the `target` system is disabled, players will see a **text label** above the NPC, such as `[E] - Supermarket 24/7`. They can then press the key (e.g., `E` with key code `38`) to interact with the NPC.
* This method is simpler and does not require an external resource but still provides basic interaction functionality.

**Summary of Behavior Based on `Config.Target.enabled`**

| **Enabled** | **Method**                             | **Resource**         | **Interaction**                                               | **Key Binding**            |
| ----------- | -------------------------------------- | -------------------- | ------------------------------------------------------------- | -------------------------- |
| `true`      | Uses target system (e.g., `ox_target`) | `ox_target`          | Dynamic NPC interaction (circle, icons)                       | Configured via `ox_target` |
| `false`     | Draws text above the NPC's head        | No external resource | Simple interaction with text (e.g., `[E] - Supermarket 24/7`) | Customizable via `key`     |
