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

# npc.lookat\_24f

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

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x024F`                                                                |
| 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         | 195 calls in 58 of 1114 scripts                                         |

## What it does

Turns the NPC's head toward a point of the map and holds the script until the head is there. The head keeps looking at that point until [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md). The body does not turn.

## Arguments

### `x` (Float)

The point's x, in map coordinates (the same as [setpos](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setpos.md)).

### `y` (Float)

The point's height: about the NPC's own `y` plus its eye height for a face, its `y` for something on the floor.

### `z` (Float)

The point's z.

## Timing

Waits until the head has turned. The head turns at the NPC's own head speed; there is no duration argument.

## In NPC Kit

In the editor's Head group, live on the selected NPC, with its own position as the starting point. [rlookat\_257](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rlookat_257.md) is the same turn without the wait (the two share their start).

## Used with

* [rlookat\_257](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rlookat_257.md): the same, the script goes on at once.
* [lookata](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookata.md): toward an actor instead of a point.
* [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md): the head back to straight.

## Example

A guard checks the gate before answering.

```lua
local nobody = [[
Nobody passes tonight, by the captain's orders.
Come back in the morning, when the gate opens.
]]

talk = function()
    talkOpen();
    npc.lookat_24f(104.0, 21.5, 96.0);   -- the gate; waits for the head
    npc.wait(20);
    npc.lookatoff();
    npc.lua(function(handle) say(handle, nobody) end);
    talkClose();
end,
```

## Pitfalls

* The point is in map coordinates, not relative to the NPC: move the NPC and the point stays.
* The head stays on the point: `lookatoff` before the NPC walks away.
