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

# npc.setautorelax

```lua
npc.setautorelax(state)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0266`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 1195 calls in 193 of 1114 scripts |

## What it does

Turns the NPC's "relax" on (`1`) or off (`0`). On, a motion that ends goes back to the model's relaxed motion, and [stdmotionreadsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionreadsync.md) stands the NPC up as soon as a new package is in. Off, a motion that ends stays on its last frame.

## Arguments

### `state` (Int)

`1` on, `0` off. Vanilla: `0` 798 times, `1` 397.

## Timing

Returns at once.

## In NPC Kit

* **Put `setautorelax(1)` first in `init`.** The game turns it on by default only for actors of script set 0; a kit NPC is in another set and starts with it off, so without the call its motions freeze on their last frame.

## Used with

* [stdmotionread](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionread.md) / [stdmotionreadsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionreadsync.md): with it on, the sync plays the stand when the package is in.
* [stdmotionplay\_2c2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/stdmotionplay_2c2.md): what plays, and what it relaxes from.

## Example

```lua
init = function()
    npc.setautorelax(1);
    npc.usecharhit(0);
    npc.bindp2_d4(0x006E0019, 4, 3);
    -- ...
end,
```

## Pitfalls

* Turned off for a pose that must hold (a scene's last frame), turn it back on after, or the NPC's next motions stop on their last frame too.
