> 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.game.md).

# api.game

Players, weapons, deflects, round state and the UseItem remote.

Helpers any Lua type can use.

## Players

| Function                    | Returns                                |
| --------------------------- | -------------------------------------- |
| `api.game.players()`        | the live player list — don't modify it |
| `api.game.is_alive(player)` | `true` if their humanoid has health    |
| `api.game.is_ally(player)`  | `true` if they are your teammate       |

## Weapons

| Function                         | Returns                             |
| -------------------------------- | ----------------------------------- |
| `api.game.weapon(player)`        | `name, item` of the equipped weapon |
| `api.game.is_deflecting(player)` | `true` while they are deflecting    |

```lua
for _, p in api.game.players() do
    local name = api.game.weapon(p)
    if name and api.game.is_deflecting(p) then
        print(p.Name, "is deflecting with", name)
    end
end
```

## Using items

### `api.game.use_item(...)`

Fires the game's **UseItem** remote with exactly the arguments you pass. Nothing is added, checked or changed — you're expected to know what to send.

```lua
api.game.use_item(arg1, arg2, arg3)
```

{% hint style="warning" %}
A wrong payload can be rejected by the server or flagged. Test on an alt.
{% endhint %}

## Round

| Function            | Returns                                                                          |
| ------------------- | -------------------------------------------------------------------------------- |
| `api.game.status()` | `"Voting"`, `"RoundStarting"`, `"RoundStarted"`, `"RoundFinished"`, ... or `nil` |

Your current duel is passed to ragebot hooks as the `duel` argument of `lua.step` and `lua.target`.

## Slots

### `api.active(slot)` → handle | `nil`

The Lua that owns `"ragebot"` or `"misc"`.

```lua
local planner = api.active("ragebot")
print(planner and planner.name or "no planner")
```


---

# 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.game.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.
