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

# npc.effectplay\_e2

```lua
npc.effectplay_e2(slot, part)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x00E2`                          |
| arguments               | 2: Int, Int                       |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 1244 calls in 274 of 1114 scripts |

## What it does

Plays the effect loaded in a script effect slot. Part `0` starts it; vanilla then plays further parts of the same slot (`1`, `2`, ...) for the next beats of the effect.

## Arguments

### `slot` (Int)

The slot, 0 to 31 (others are clamped), loaded by a read and its sync.

### `part` (Int)

Which part of the effect. Vanilla: `0` (the first play), then `1`, `2`, `3` up to `10`, often `0` and `1` back to back.

## Timing

Returns at once; the effect plays on its own.

## In NPC Kit

It plays only on a slot whose file has loaded ([effectreadsync\_e1](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectreadsync_e1.md) first), or one already played. Where the effect shows is set by its file, not by the NPC calling it. Not tested on a kit NPC.

## Used with

* [effectreadsync\_e1](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectreadsync_e1.md) before it.
* [effectsync\_e3](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectsync_e3.md): hold until it is over.
* [effectcancel\_e4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectcancel_e4.md): stop it.

## Example

The vanilla shape: two parts back to back, then held until the effect is gone.

```lua
flash = function()
    npc.questeffectread_1db(16, 116);
    npc.effectreadsync_e1(16);
    npc.effectplay_e2(16, 0);
    npc.effectplay_e2(16, 1);
    npc.effectsync_e3(16);
end,
```

## Pitfalls

* On a slot still loading, never read, or cancelled, it plays nothing, with no error.
* After [effectcancel\_e4](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectcancel_e4.md) the slot needs reading again before it plays.
