> ## Documentation Index
> Fetch the complete documentation index at: https://luau.limerence.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> The api table available in every Luau script.

Every script gets one `api` table. You can read its fields but not replace them.

Limerence runs in more than one game, so which namespaces exist (and which calls live inside them) depends on where you are. See [Game support](/game-support) before writing scripts meant to run in more than one game.

## Members

<ResponseField name="name" type="string" required>
  Your script's filename, without the `.luau` extension. Anything you save uses this as a prefix: `luau.{api.name}.{key}`.
</ResponseField>

<ResponseField name="ui" type="table" required>
  Tabs, sections, widgets. [UI overview](/ui/overview).
</ResponseField>

<ResponseField name="getGame" type="function" required>
  The game you're running in, as a lowercase name. See [getGame](#getgame) below.
</ResponseField>

<ResponseField name="utility" type="table" required>
  Signal connect, the asset index, archives, and the config-loaded signal. [Utility](/utility/overview).
</ResponseField>

<ResponseField name="bind" type="table" required>
  Keybinds the user set on UI elements. [Bind](/bind/overview).
</ResponseField>

<ResponseField name="legitbot" type="table" required>
  Aim / triggerbot state and hooks. [Legitbot](/legitbot/overview).
</ResponseField>

<ResponseField name="ragebot" type="table">
  Automatic ragebot fire. Bloxstrike, Rivals, and Apocalypse Rising 2. [Ragebot](/ragebot/overview).
</ResponseField>

<ResponseField name="world" type="table">
  Bloxstrike, Rivals, Overkill, Phantom Forces, and Murderers vs Sheriffs Duels. [World](/world/overview).
</ResponseField>

<ResponseField name="universal" type="table">
  Universal mode only (any game without built-in support). Teach universal mode where characters, health, teams, and weapons live, report your hits and shots, and register NPC targets. [Universal](/universal/overview).
</ResponseField>

<ResponseField name="feature" type="table" required>
  Groups per-feature namespaces. The table itself exists in every game; a sub-namespace is only present where its feature is, so check before using it: `if api.feature.autoloot then ... end`.

  * `feature.autoloot`: watch and shape Auto Loot. Apocalypse Rising 2 only. [Auto Loot](/feature/overview#auto-loot).
  * `feature.musichud`: every game. [Music HUD](/feature/overview#music-hud).
  * `feature.autopeek`: drive Auto Peek. Bloxstrike, Rivals, Overkill, Murderers vs Sheriffs Duels. [Auto Peek](/feature/overview#auto-peek).
  * `feature.antiaim`: set the direction others see you facing. Bloxstrike. [Anti Aim](/feature/overview#anti-aim).
</ResponseField>

<ResponseField name="autoloot" type="table" deprecated>
  Deprecated alias for `api.feature.autoloot`. [Auto Loot](/feature/overview#auto-loot).
</ResponseField>

<ResponseField name="client" type="table" required>
  Your local player: shared core plus per-game extras. Shared calls exist in Bloxstrike, Rivals, Apocalypse Rising 2, and universal mode; Phantom Forces and Overkill expose only the `onHit` / `onKill` signals. [Client](/client/overview).
</ResponseField>

<ResponseField name="players" type="table">
  Every other player in the match. Present when the game has a player API (Bloxstrike, Rivals, Apocalypse Rising 2, universal mode). [Players](/players/overview).
</ResponseField>

<ResponseField name="game" type="table" required>
  Match state. Contents differ per game (Bloxstrike: bomb and hostage; Rivals: match/environment/placeables; Apocalypse Rising 2: world pings/squad/zombies; [Phantom Forces](/game/phantom-forces): match/rounds/dropped weapons/grenades; [Overkill](/game/overkill): match/teams/matchmaking/projectiles; [Murderers vs Sheriffs Duels](/game/murderers-vs-sheriffs-duels): match and team state). [Game](/game/overview).
</ResponseField>

<ResponseField name="onUnload" type="function" required>
  Run a callback once when the script unloads. See [onUnload](#onunload) below.
</ResponseField>

## getGame

```luau theme={null}
api.getGame(): string
```

The game you're running in, as a lowercase name: `"bloxstrike"`, `"rivals"`, `"apocalypse rising 2"`, `"phantom forces"`, `"overkill"`, `"murderers vs sheriffs duels"`, or `"operation one"`. In a game without built-in support it returns `"universal"`. See [Universal](/universal/overview).

## onUnload

```luau theme={null}
api.onUnload(callback: () -> ()): ()
```

Run your callback once when the script unloads (manual unload, file delete, or reload). Use this for anything [auto-cleanup](/cleanup) doesn't handle, like stopping a listener you created with `OnChange` or `OnUpdate`.

```luau theme={null}
local stop = handle:OnUpdate(applyColor)
api.onUnload(stop)
```

<CardGroup cols={2}>
  <Card title="UI" href="/ui/overview" />

  <Card title="Utility" href="/utility/overview" />

  <Card title="Bind" href="/bind/overview" />

  <Card title="Legitbot" href="/legitbot/overview" />

  <Card title="Ragebot" href="/ragebot/overview" />

  <Card title="World" href="/world/overview" />

  <Card title="Universal" href="/universal/overview" />

  <Card title="Feature" href="/feature/overview" />

  <Card title="Client" href="/client/overview" />

  <Card title="Players" href="/players/overview" />

  <Card title="Game" href="/game/overview" />

  <Card title="Types" href="/reference/types" />
</CardGroup>
