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

# npc.lookata

```lua
npc.lookata(actor)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x0251`                                                                |
| arguments               | 1: Int                                                                  |
| 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         | 3001 calls in 174 of 1114 scripts                                       |

## What it does

Turns the NPC's head toward an actor and holds the script until the head is there. The head then keeps following that actor until [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md).

## Arguments

### `actor` (Int)

`-1` the character the player controls (1,351 of 3,001 vanilla calls), `0` or more an actor of the script; in the kit another NPC is `npc.actor("id")` (in a talk).

## Timing

Waits until the head has turned.

## In NPC Kit

[rlookata](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rlookata.md) is the same without the wait; the scene example uses it so the head follows another NPC while the body turns.

## Used with

* [lookatoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/lookatoff.md): the head back to straight (in `talkClose`).
* [rlookata](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rlookata.md): no wait.

## Example

The owner's head turns to the guest who walks in, and the line comes once the head is there.

```lua
guestArrives = function()
    local guest = npc.on("npckit_0022")
    guest.show();
    guest.showshadow();
    npc.lookata(npc.actor("npckit_0022"));   -- waits for the head
    npc.stdmotionplay_2c2(0x01000010, 20);   -- talk, happy
end,
```

## Pitfalls

* The head keeps following: `lookatoff` in `talkClose`, or it stays turned after the talk.
