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

# Rivals

> Rivals api.game: match status, environment, and placeables.

**Rivals only.** On Rivals, `api.game` gives you match / environment / placeable info instead of bomb / hostage. Every getter returns the current value the moment you call it.

## Getters

| Call                 | Returns              | What it tells you                                       |
| -------------------- | -------------------- | ------------------------------------------------------- |
| `isInGame()`         | `boolean`            | `true` while you're in an active match (not the lobby). |
| `getTeamId()`        | `string`             | Your team id (`""` when none).                          |
| `getEnvironmentId()` | `string`             | Your current environment/zone id (`""` when none).      |
| `getPlaceables()`    | `{ PlaceableEntry }` | Every tracked placeable in the world right now.         |
| `getPlaceable(id)`   | `PlaceableEntry?`    | One placeable by its id, or `nil`.                      |
| `getGrenades()`      | `{ Grenade }`        | Grenades in the air right now.                          |

Each `Grenade`: `{ id, name, position, detonateAt, friendly }`. `position` is the predicted landing spot, `detonateAt` compares against `os.clock()`. See [PlaceableEntry](/reference/types#game-types) and [Grenade](/reference/types#game-types).

## Signals

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

| Signal                 | When your callback runs                     |
| ---------------------- | ------------------------------------------- |
| `onInGameChanged`      | `(inGame)`: you entered or left a match     |
| `onTeamChanged`        | `(teamId)`: your team id changed            |
| `onEnvironmentChanged` | `(environmentId)`: your environment changed |
| `onPlaceableAdded`     | `(id, placeable)`: a placeable appeared     |
| `onPlaceableRemoved`   | `(id, placeable)`: a placeable was removed  |
| `onGrenadeAdded`       | `(grenade)`: a grenade was thrown           |
| `onGrenadeRemoved`     | `(grenade)`: a grenade detonated or expired |

## Example

```luau theme={null}
if api.game.getPlaceables then
    api.game.onPlaceableAdded:Connect(function(id, placeable)
        if not placeable.friendly then
            print("enemy placeable:", placeable.kind, "at", placeable.position)
        end
    end)
end
```
