> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/plugins/ak47_target.md).

# ak47\_target

<figure><img src="/files/AmYxlW4uAvYyW41AfSjD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/n0ayVBDTYszDxvyXDR7N" alt=""><figcaption></figcaption></figure>

ak47\_target is designed to be a seamless, 100% drop-in replacement for `ox_target`, `qb-target`, and `qtarget`.

You do not need to rewrite your existing scripts or change your exports. `ak47_target` natively intercepts the export calls meant for those older resources and automatically translates them into its own optimized format.

#### Supported Scripts

* ox\_target (Fully supported via `ox_target` export handlers)
* qb-target (Fully supported via `qb-target` export handlers)
* qtarget (Fully supported via `qtarget` export handlers)

#### Installation

1. Download the latest release from the repository.
2. Extract the `ak47_target` folder into your server's `resources` directory.
3. Ensure you completely stop and remove any existing targeting scripts (e.g., `qb-target`, `ox_target`).
4. Add `start ak47_target` after the framework (es\_extended/qb-core/qbx\_core) to your `server.cfg`.

#### How it Works

Under the hood, `ak47_target` registers event handlers for `__cfx_export_ox_target_%s`, `__cfx_export_qb-target_%s`, and `__cfx_export_qtarget_%s`.

This means if you have an older script that calls:

```lua
-- An old qb-target export
exports['qb-target']:AddBoxZone("BankZone", vector3(100.0, 100.0, 30.0), 2.0, 2.0, {
    name = "BankZone",
    heading = 0.0,
    debugPoly = false,
    minZ = 28.0,
    maxZ = 32.0,
}, {
    options = {
        {
            type = "client",
            event = "bank:open",
            icon = "fas fa-university",
            label = "Open Bank",
            job = "all"
        }
    },
    distance = 2.5
})
```

...`ak47_target` will automatically catch this, format the legacy options (like converting `job` to `groups`, or `type = "client"` to standard events), and register it as an `ak47_target` box zone.

#### Legacy Functions Handled

All standard functions from the supported target scripts are automatically redirected, including:

* `AddBoxZone` / `AddPolyZone` / `AddCircleZone`
* `AddTargetModel` / `RemoveTargetModel`
* `AddTargetEntity` / `RemoveTargetEntity`
* `AddGlobalPed` / `AddGlobalVehicle` / `AddGlobalObject` / `AddGlobalPlayer`
* And their respective `ox_target` equivalents like `addBoxZone`, `addGlobalPed`, `removeZone`, etc.

*(Note: The deprecated `AddEntityZone` from `qb-target` is also safely re-routed to `AddTargetEntity` with a console warning)*.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.menanak47.com/plugins/ak47_target.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.
