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

# Overkill

> Overkill api.game: match and team state, matchmaking, and live projectiles.

**Overkill only.** Match and team state, matchmaking, and live projectiles. Every getter returns the current value the moment you call it.

## Getters and methods

| Call               | Returns          | What it tells you                            |
| ------------------ | ---------------- | -------------------------------------------- |
| `isInMatch()`      | `boolean`        | Whether you're in a match.                   |
| `isInLobby()`      | `boolean`        | Whether you're in the lobby.                 |
| `getMatchId()`     | `any?`           | The current match id, or `nil` in the lobby. |
| `getTeamId()`      | `string?`        | Your team id, or `nil` when you have none.   |
| `getProjectiles()` | `{ projectile }` | Live thrown projectiles. See below.          |
| `queueMatch(mode)` |                  | Queue for a match, e.g. `queueMatch("1v1")`. |
| `cancelQueue()`    |                  | Cancel matchmaking.                          |
| `leaveMatch()`     |                  | Leave the current match.                     |

Each `projectile`: `{ id, name, position, detonateAt, explosive, radius, friendly }`. `position` is the predicted current position, `detonateAt` compares against `os.clock()` (`nil` when it has no fuse).

## Signals

Call `:Connect(callback)` on these. They get cleaned up when your script unloads.

| Signal                | Your callback receives                         |
| --------------------- | ---------------------------------------------- |
| `onMatchChanged`      | `(matchId?)`: you entered or left a match.     |
| `onTeamChanged`       | `(teamId?)`: your team changed.                |
| `onProjectileAdded`   | `(projectile)`: a projectile was thrown.       |
| `onProjectileRemoved` | `(projectile)`: it detonated, hit, or expired. |

## Example

```luau theme={null}
-- Auto-requeue after every match
api.game.onMatchChanged:Connect(function(matchId)
    if matchId == nil then
        task.wait(2)
        api.game.queueMatch("1v1")
    end
end)
```
