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

# npc.setcharseplay

```lua
npc.setcharseplay(state)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x026C`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 1118 calls in 151 of 1114 scripts |

## What it does

Lets the sounds from the NPC's own sound bank play (`1`), or silences them (`0`). Every sound the game takes from the actor's bank passes this switch, the `charseplay_*` calls among them.

## Arguments

### `state` (Int)

`1` on, `0` silent. Vanilla: `1` 792 times, `0` 326.

## Timing

Returns at once.

## In NPC Kit

A kit NPC starts with it **off**: the game turns it on by default only for the map's own actors (set 0). Call `setcharseplay(1)` in `init` for an NPC whose bank sounds must be heard. Which sounds that brings in on a kit NPC is not tested.

## Used with

* [setcharseplayall](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setcharseplayall.md): every character at once.

## Example

An NPC with its bank sounds on, silenced for one walk.

```lua
init = function()
    -- ...
    npc.setcharseplay(1);   -- off by default on a kit NPC
end,

sneak = function()
    npc.setcharseplay(0);
    npc.aturn(33.0, -9.0, 68.6);
    npc.move(33.0, -9.0, 68.6);
    npc.setcharseplay(1);
end,
```

## Pitfalls

* Off by default on a kit NPC: `setcharseplay(0)` alone changes nothing.
* [setcharseplayall](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/setcharseplayall.md) `(0)` silences it too, whatever this switch says.
