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

# npc.setweight

```lua
npc.setweight(weight)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0084`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 4317 calls in 295 of 1114 scripts |

## What it does

Sets the NPC's push weight: who gives way when two characters' bodies overlap.

## Arguments

### `weight` (Int)

`-1` is what NPCs use (4,277 of 4,317 vanilla calls): the NPC isn't pushed. Other vanilla values: `0`, `1`, `2`, `2.5`, `3`, `100`, `200`, a handful each. The game reads it as an integer (`2.5` is `2`) and stores it as a float.

## Timing

Returns at once.

## In NPC Kit

`setweight(-1)` in every NPC's setup, with [usecharhit](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/usecharhit.md)`(1)` and [set\_ignore\_hitgroup](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/set_ignore_hitgroup.md): the player walks into the NPC and the NPC stays put.

## Used with

* [usecharhit](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/usecharhit.md) before it, [set\_ignore\_hitgroup](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/set_ignore_hitgroup.md) after it.

## Example

```lua
npc.usecharhit(1);
npc.setweight(-1);
npc.set_ignore_hitgroup(1);
```

## Pitfalls

* What each positive weight does against the party is not measured here; `-1` is the tested value.
