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

# npc.movesync

```lua
npc.movesync()
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x003D`                                                                |
| arguments               | 0                                                                       |
| 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         | 255 calls in 83 of 1114 scripts                                         |

## What it does

Holds the script until the NPC's walk has ended, by arriving or by a [movecancel](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/movecancel.md).

## Timing

Waits, once a frame, while the walk runs. No limit.

## In NPC Kit

After an `rmove` that must finish before the next beat; in a talk a blocked walk holds the player.

## Used with

* [rmove](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rmove.md), [rmove\_43](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rmove_43.md), [movecancel](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/movecancel.md).

## Example

`rmove` starts the walk and returns; `movesync` waits for it, so the line comes once the NPC has arrived.

```lua
approach = function()
    npc.aturn(31.0, -9.0, 66.0);
    npc.rmove(31.0, -9.0, 66.0);
    npc.movesync();
    npc.stdmotionplay_2c2(0x01000002, 20);
end,
```

## Pitfalls

* No limit: a blocked walk holds the script. For a limit, `wait` + [movecancel](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/movecancel.md).
