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

# npc.turnt

```lua
npc.turnt(x, y, z, milliseconds)
```

|                         |                                                   |
| ----------------------- | ------------------------------------------------- |
| id                      | `0x0064`                                          |
| arguments               | 4: Float, Float, Float, Int                       |
| in NPC Kit              | yes                                               |
| measured from a kit NPC | waits: holds the script until its condition holds |
| vanilla scripts         | 1040 calls in 345 of 1114 scripts                 |

## What it does

Turns the NPC's body to face a ground point over a set number of frames, and holds the script until the turn ends. [turn](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turn.md) with a duration.

## Arguments

### `x` (Float)

The point's x, in map coordinates.

### `y` (Float)

Popped, but the turn doesn't use it: pass the NPC's own height or `0`.

### `z` (Float)

The point's z. Vanilla passes the map-jump point (`mp_map_set_x, _y, _z`) in 966 of 1,040 calls.

### `milliseconds` (Int)

Despite the name, the number of frames the turn takes. Vanilla: `20` (680 calls) and `0` (357). `0` or less is the shortest turn.

## Timing

Waits until the turn has ended.

## In NPC Kit

In the editor's Turn group, live, with a point 2 ahead of the NPC and 20 frames as defaults.

## Used with

* [turn](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turn.md): the same at the normal turn speed.
* [turnsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turnsync.md): not needed, `turnt` waits itself.
* [turncancel](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turncancel.md): stops it where it is.

## Example

The NPC turns, slowly, toward the door it was told about.

```lua
lookToDoor = function()
    npc.turnt(91.3, 0, 130.0, 40);   -- 40 frames; waits
    npc.stdmotionplay_2c2(0x01000002, 20);
end,
```

## Pitfalls

* The point is a map point, not an angle: for a heading use [turn\_62](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/turn_62.md).
