> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/wait.md).

# npc.wait

```lua
npc.wait(frames)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x0000`                                                                |
| arguments               | 1: Int                                                                  |
| in NPC Kit              | yes                                                                     |
| measured from a kit NPC | returns                                                                 |
| waits                   | it has a wait handler: it can hold the script, and in `talk` the player |
| vanilla scripts         | 83795 calls in 1081 of 1114 scripts                                     |

## What it does

Holds the NPC's script for a number of frames, then lets it go on. It is how a script gives frames back to the game: every `main` needs one, or it never lets the game draw a frame.

## Arguments

### `frames` (Int)

How long to wait. Vanilla's most common values: `1` (29,737 calls), `30`, `6`, `10`, `15`, `2`, `5`, `8`, `20`, `60`.

## Timing

Waits, checking once a frame, until the count runs out. With the game in 60 fps mode the game doubles a count of 2 or more, so `wait(n)` lasts `2n` frames there; a count of `1` (or `0`) is not doubled except on four locations. On a few other locations and story points, and in some script sets, no count is doubled. A skipped cutscene ends a running wait on the next frame.

## In NPC Kit

* Every `main` must hold at least one `wait`: `main` repeats, and with no wait it freezes the game.
* In `talk` a `wait` holds the player for its whole length.
* The kit's own `npc.lua` in a talk is not a `wait`: it holds the script until `handle.finish()`.

## Used with

* [move](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/move.md), [aturn](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aturn.md): a walker's `main` is a turn, a walk and a `wait`.
* [fadeout](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadeout.md) / [fadein](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadein.md): `wait(3)` between a camera cut and the fade in, so the first frame shows the new shot.
* [stdmotionplay\_2c2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionplay_2c2.md): a gesture, a `wait` for it to play, back to the idle.

## Example

```lua
main = function()
    npc.aturn(33.0, -9.0, 68.6);
    npc.move(33.0, -9.0, 68.6);
    npc.wait(90);
    npc.aturn(29.4, -9.0, 68.6);
    npc.move(29.4, -9.0, 68.6);
    npc.wait(90);
end,
```

## Pitfalls

* A `wait` count is not the same unit as the frame counts of the timed calls (`setkutipakustatus_4a2` and the like), which the game does not double: don't pair them by number.
