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

# npc.getz

```lua
npc.getz()
```

|                         |                                                                    |
| ----------------------- | ------------------------------------------------------------------ |
| id                      | `0x006F`                                                           |
| arguments               | 0                                                                  |
| result                  | Float: goes to the very next call, or to `npc.lua(npc.getz(), fn)` |
| in NPC Kit              | yes                                                                |
| measured from a kit NPC | returns                                                            |
| vanilla scripts         | 976 calls in 172 of 1114 scripts                                   |

## What it does

Gives the NPC's z position. A result.

## Result

The z, a float.

## Timing

Returns at once.

## In NPC Kit

As [getx](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/getx.md): compute positions in Lua when `npc.add` runs; in `npc.lua` it arrives cut to an integer.

## Used with

* [getx](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/getx.md), [gety](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/gety.md).

## Example

```lua
local home = { 29.36, -9.0, 68.65 }

pace = function()
    npc.aturn(home[1], home[2], home[3] + 2.0);
    npc.move(home[1], home[2], home[3] + 2.0);
end,
```
