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

# npc.bindp2

```lua
npc.bindp2(model)
```

|                         |                                                   |
| ----------------------- | ------------------------------------------------- |
| id                      | `0x00BD`                                          |
| arguments               | 1: Int                                            |
| in NPC Kit              | yes                                               |
| measured from a kit NPC | waits: holds the script until its condition holds |
| vanilla scripts         | 2061 calls in 340 of 1114 scripts                 |

## What it does

[bindp2\_d4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/bindp2_d4.md)`(model, 1, 0)`: gives the NPC a model with variation 1 and colour 0, and holds the script until it loads.

## Arguments

### `model` (Int)

The model key. In NPC Kit the absolute key of `data/model-*.csv` (`0x006E0019`); vanilla's `0x03000000 + n` is an entry of the map script's model list, which a kit NPC has none of.

## Timing

Waits until the model is loaded.

## In NPC Kit

Use `bindp2_d4` to choose the variation and colour; `bindp2` fixes them at `(1, 0)`. A file-relative key holds `init` for good.

## Used with

* [bindp2\_d4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/bindp2_d4.md), [stdmotionread](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionread.md).

## Example

`bindp2` is `bindp2_d4` with variation 1 and colour 0. For an NPC that is right with those:

```lua
init = function()
    npc.setautorelax(1);
    npc.usecharhit(0);
    npc.bindp2(0x006E0019);
    npc.stdmotionread(16);
    npc.stdmotionreadsync();
    npc.stdmotionplay_2c2(0x01000000, 0);
    -- ... the rest of the vanilla init ...
end,
```

## Pitfalls

* Vanilla's `0x03000000 + n` keys hold a kit NPC's `init` for good: use the absolute key.
