> 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/motionsync_282.md).

# npc.motionsync\_282

```lua
npc.motionsync_282(ready)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x0282`                                                                |
| 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         | 15090 calls in 449 of 1114 scripts                                      |

## What it does

Holds the script until the NPC's current motion has ended. With `ready` set, it also lets go when the NPC is back in a ready (standing or casting) motion.

## Arguments

### `ready` (Int)

`1`: end also when the NPC stands in a ready motion. Vanilla passes `1` in all but one of 15,090 calls.

## Timing

Waits, once a frame, until the motion has ended (or, with `1`, the NPC stands ready). A skipped cutscene ends it. Whether a looping motion ever counts as ended is not confirmed here: keep `1`.

## In NPC Kit

A kit NPC's probe returns from it. Waiting this way for a standard gesture is the vanilla pattern, but not yet run on a kit NPC in the game: test it before relying on it.

## Used with

* [stdmotionplay\_2c2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionplay_2c2.md) just before it.
* [motionloop](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/motionloop.md): whether the motion loops.

## Example

```lua
gesture = function()
    npc.stdmotionplay_2c2(0x01000013, 20);   -- laugh
    npc.motionsync_282(1);
    npc.stdmotionplay_2c2(0x01000002, 20);
end,
```

## Pitfalls

* In a talk, a motion that doesn't end holds the player; keep `1`.
