> ## 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-only PlayerHandle methods and signals.

**Rivals only.** Guard with `if handle.x then` before calling on other games.

## Handle methods

| Method                                                                                | Returns      | What it tells you               |
| ------------------------------------------------------------------------------------- | ------------ | ------------------------------- |
| `getEnvironmentId()`                                                                  | `string`     | Their environment/zone id.      |
| `getItems()`                                                                          | `{ string }` | Names of items they carry.      |
| `getVelocity()`                                                                       | `Vector3`    | Their velocity.                 |
| `getLevel()` / `getWinStreak()` / `getDisplayElo()`                                   | `number`     | Account level, win streak, ELO. |
| `isInDuel()` / `isSpectating()` / `isCrouching()` / `isSliding()` / `isFirstPerson()` | `boolean`    | Movement / duel state.          |
| `isFrozen()` / `isInvincible()` / `isHidden()` / `isBlocking()` / `isDeflecting()`    | `boolean`    | Combat / visibility state.      |
| `isHealing()`                                                                         | `boolean`    | `true` while they use a medkit. |

## Signals

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

| Signal                 | Your callback receives    |
| ---------------------- | ------------------------- |
| `onEnvironmentChanged` | `(player, environmentId)` |
| `onFrozenChanged`      | `(player, frozen)`        |
| `onInvincibleChanged`  | `(player, invincible)`    |
| `onDuelChanged`        | `(player, inDuel)`        |
| `onBlockingChanged`    | `(player, blocking)`      |
| `onDeflectingChanged`  | `(player, deflecting)`    |
| `onHealingChanged`     | `(player, healing)`       |

## Example

```luau theme={null}
if api.players.onDuelChanged then
    api.players.onDuelChanged:Connect(function(player, inDuel)
        print(player.Name, inDuel and "entered a duel" or "left a duel")
    end)
end
```
