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

# npc.aturn

```lua
npc.aturn(x, y, z)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x0260`                                                                |
| arguments               | 3: Float, Float, Float                                                  |
| 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         | 382 calls in 95 of 1114 scripts                                         |

## What it does

Turns the NPC's body to face a point and points its head at it, holding the script until the turn ends.

## Arguments

### `x` (Float)

### `y` (Float)

### `z` (Float)

The point, in map coordinates. The body turns toward `(x, z)`; `y` is the height the head looks at.

## Timing

Waits until the turn has ended.

## In NPC Kit

A walker's routine turns to the next point, then walks there:

```lua
main = function()
    npc.aturn(x + 4.0, y, z);
    npc.move(x + 4.0, y, z);
    npc.wait(90);
end,
```

## Used with

* [move](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/move.md) / [rmove](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rmove.md) after it: walk where it now faces.
* [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md): the head back to straight after.
* [turn](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turn.md): the body turn only.
* [aturn\_261](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aturn_261.md): a heading instead of a point.

## Example

A guard who walks between two posts, turning to face each before it walks there.

```lua
main = function()
    npc.aturn(33.0, -9.0, 68.6);
    npc.move(33.0, -9.0, 68.6);
    npc.wait(90);
    npc.aturn(29.4, -9.0, 68.6);
    npc.move(29.4, -9.0, 68.6);
    npc.wait(90);
end,
```

## Pitfalls

* The head stays on the point: [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md) before a talk, or the NPC keeps looking away.
