> For the complete documentation index, see [llms.txt](https://scripter-sm.gitbook.io/elite-zone/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripter-sm.gitbook.io/elite-zone/api-reference/api.targeting.md).

# api.targeting

See and override who aimbot, flickbot, silent aim and triggerbot are targeting.

Aimbot, flickbot, silent aim and triggerbot each pick a target every frame they run. A misc Lua (`"misc"` or `"both"`) can see that target, change it, or take over the whole selection.

**Features:** `"aimbot"`, `"flickbot"`, `"silentaim"`, `"triggerbot"`.

## Target table

| Field       | Type       | Meaning                 |
| ----------- | ---------- | ----------------------- |
| `player`    | `Player`   | who                     |
| `character` | `Model`    | their character         |
| `part`      | `BasePart` | the part being aimed at |
| `position`  | `Vector3`  | where that part is      |
| `distance`  | `number`   | studs from your camera  |

## Functions

### `api.targeting.target(feature)` → target | `nil`

The last target that feature picked. It updates every frame the feature is actively looking for a target (for example, while the aimbot key is held).

### `api.targeting.make(player, part?)` → target | `nil`

Builds a target for `player`. `part` is a part name like `"HitboxHead"` or `"HitboxBody"`, or a `BasePart`. Defaults to the head. Returns `nil` if their character isn't loaded.

## Hooks

Set these on your handle. Both run every frame, for every feature that is looking for a target.

### `lua.aim_select(feature)` → target | `false` | `nil`

Replaces **how** the target is chosen. Elite Zone's own selection only runs if you return `nil`.

### `lua.aim_target(feature, target)` → target | `false` | `nil`

Runs **after** selection (yours or Elite Zone's) with the chosen `target` (`nil` if none). Change the result.

| Return   | Effect               |
| -------- | -------------------- |
| a target | use this target      |
| `false`  | no target this frame |
| `nil`    | keep what was there  |

{% hint style="info" %}
Return the same thing for every `feature` to override the shared target, or check `feature` to override just one.
{% endhint %}

{% hint style="danger" %}
If a hook errors, the misc Lua is unloaded and the features go back to normal.
{% endhint %}

```lua
local lua = api.register("Lowest HP", "misc")

lua.aim_target = function(feature, target)
    if feature ~= "aimbot" then
        return
    end
    local best, hp = nil, math.huge
    for _, p in api.game.players() do
        local char = p.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        if hum and hum.Health > 0 and hum.Health < hp and not api.game.is_ally(p) and p ~= game.Players.LocalPlayer then
            best, hp = p, hum.Health
        end
    end
    return best and api.targeting.make(best) or target
end

lua:override()
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://scripter-sm.gitbook.io/elite-zone/api-reference/api.targeting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
