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

# npc.waitdistance

```lua
npc.waitdistance(x, z, radius)
```

|                         |                                                   |
| ----------------------- | ------------------------------------------------- |
| id                      | `0x0534`                                          |
| arguments               | 3: Float, Float, Float                            |
| in NPC Kit              | yes                                               |
| measured from a kit NPC | waits: holds the script until its condition holds |
| vanilla scripts         | 5032 calls in 7 of 1114 scripts                   |

## What it does

Holds the script until the NPC is within `radius` of a ground point: for a walk started with [rmove](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rmove.md), going on when it is close instead of when it stops.

## Arguments

### `x` (Float)

### `z` (Float)

The ground point; the height doesn't count.

### `radius` (Float)

How close. Every vanilla call passes `0.5`.

## Timing

Waits, once a frame, until the NPC is that close. No limit: an NPC that never gets there holds the script for good.

## In NPC Kit

Pair it with a walk that can reach the point; in a talk, a blocked walk holds the player.

## Used with

* [rmove](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rmove.md) before it.
* [movecancel](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/movecancel.md) in case.

## Example

```lua
npc.rmove(33.0, -9.0, 68.6);
npc.waitdistance(33.0, 68.6, 0.5);
```
