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

# npc.setnpcname

```lua
npc.setnpcname(id)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x038A`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 6220 calls in 549 of 1114 scripts |

## What it does

Sets the NPC's name tag from the game's name dictionary: a name id instead of text.

## Arguments

### `id` (Int)

A name dictionary id. Vanilla: `0x01b2` (2,013 calls), `0x041c`, `-1`.

## Timing

Returns at once.

## In NPC Kit

**Use `name` in `npc.add` instead.** The kit writes the NPC's name tag from that text itself; `setnpcname` would put a dictionary name in its place. Which name each id gives has no bundled table, and the call is not tested on a kit NPC.

## Used with

* `name` in `npc.add` (`references/api.md`, `npc.add`).

## Example

The kit's name tag is the `name` field; no call is needed.

```lua
npc.add {
    id = "npckit_0024",
    map = 290,
    name = "NPCKit 0024",      -- the name tag over its head
    init = function() placeNpc(0x006E0019, 29.36, -9.0, 68.65, 1.676); end,
    main = function() npc.wait(90); end,
}
```

## Pitfalls

* `npc.setnpcname(id)` would replace the kit's text with a dictionary name: not tested.
