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

# npc.bindc

```lua
npc.bindc(slot, model, point)
```

|                         |                                                   |
| ----------------------- | ------------------------------------------------- |
| id                      | `0x0200`                                          |
| arguments               | 3: Int, Int, Int                                  |
| in NPC Kit              | yes                                               |
| measured from a kit NPC | waits: holds the script until its condition holds |
| vanilla scripts         | 1561 calls in 97 of 1114 scripts                  |

## What it does

Attaches a second model to the NPC, at an attach point of its main model (a prop in its hand, a piece of gear), in one of two extra slots. Holds the script until the model is loaded.

## Arguments

### `slot` (Int)

Which extra slot: `0` or `1`.

### `model` (Int)

The model key, as [bindp2\_d4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/bindp2_d4.md) takes it: in the kit the absolute key (`data/model-weapons.csv`, `model-gadgets.csv`).

### `point` (Int)

The attach point on the main model. Vanilla passes `2` almost always.

## Timing

Waits until the model is loaded.

## In NPC Kit

Not tested on a kit NPC with an absolute key. What is tested: a weapon model bound to its own kit NPC and tied with [attach](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/attach.md) to another NPC's slot 2 sits in the right hand as a held sword. [bindcoff](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/bindcoff.md) takes it off.

## Used with

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

## Example

The tested way to put a sword in an NPC's hand: the sword is its own kit NPC, tied to slot 2 of the holder in the holder's talk.

```lua
-- the sword: a plain NPC with a weapon model
npc.add {
    id = "npckit_0033", map = 290, name = "NPCKit 0033",
    init = function()
        npc.usecharhit(0);
        npc.bindp2_d4(0x00770016, 1, 0);   -- Broadsword
        npc.setpos2(29.36, -9.0, 68.65);
        npc.show();
    end,
    main = function() npc.wait(90); end,
}

-- in the holder's talk
npc.on("npckit_0033").attach(npc.actor("npckit_0032"), 2);
```

`npc.bindc(0, 0x00770016, 2)` on the holder itself is the vanilla way; with an absolute key it is not tested.
