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

# npc.distance\_292

```lua
npc.distance_292(x1, z1, x2, z2)
```

|                         |                                                                               |
| ----------------------- | ----------------------------------------------------------------------------- |
| id                      | `0x0292`                                                                      |
| arguments               | 4: Float, Float, Float, Float                                                 |
| result                  | float: goes to the very next call, or to `npc.lua(npc.distance_292(...), fn)` |
| in NPC Kit              | yes                                                                           |
| measured from a kit NPC | returns                                                                       |
| vanilla scripts         | 72 calls in 62 of 1114 scripts                                                |

## What it does

Gives the distance on the ground between two points (height left out). A result.

## Arguments

### `x1` (Float)

### `z1` (Float)

The first point.

### `x2` (Float)

### `z2` (Float)

The second point.

## Result

The distance, a float.

## Timing

Returns at once.

## In NPC Kit

Vanilla passes the NPC's `getx()`, `getz()` and the player's `getx_12b(-1)`, `getz_12d(-1)`; a result only reaches the next call as its first argument, so in the kit the four are numbers, and for an actor [distance\_290](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/distance_290.md) is the call. With fixed points it is plain arithmetic, which Lua does at once.

## Used with

* [distance\_290](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/distance_290.md): from an actor to a point.
