# Replay: state property

> The state read-only property of the Replay interface is the room's shared state at the tick shown.

The **`state`** read-only property of the [`Replay`](/docs/client/replay) interface is the room's shared state at the tick shown, as [`RoomClient.state`](/docs/client/room-client/state) is on a live client.

## Value

A [client entity](/docs/client/client-entity) of the schema's state kind, with its fields as properties. Its fields are typed `any`, since the kinds a replay holds are known only once it's loaded, so give them their types where you read them.

## Description

The shared state is entity 0 of [`entities`](/docs/client/replay/entities), so `replay.entities.onChange(schema.state, callback)` fires when it changes during playback.

## Examples

### Showing the score at the tick shown

A replay viewer shows the score after each tick.

```ts
// replay-score.ts
import type { Replay } from "@irtio/client/replay";

export function showScore(replay: Replay, label: HTMLElement): void {
  replay.addEventListener("tick", () => {
    const home: number = replay.state.home;
    const away: number = replay.state.away;
    label.textContent = `${home} : ${away}`;
  });
}
```

## See also

- [`Replay.entities`](/docs/client/replay/entities)
- [`Replay.privateOf()`](/docs/client/replay/privateof)
- [`RoomClient.state`](/docs/client/room-client/state)
