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

# npc.effectplay

```lua
npc.effectplay(part)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x00DD`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 1176 calls in 215 of 1114 scripts |

## What it does

Plays the effect loaded in script effect slot 0: [effectplay\_e2](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectplay_e2.md) with the slot fixed at 0.

## Arguments

### `part` (Int)

Which part of the effect; vanilla passes `0` in all but three calls.

## Timing

Returns at once; the effect plays on its own.

## In NPC Kit

Only after [effectreadsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectreadsync.md): a slot still loading plays nothing. Slot 0 is shared with the map; prefer the slot forms on 16 to 30. Not tested on a kit NPC.

## Used with

* [questeffectread](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/questeffectread.md), [effectreadsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectreadsync.md) before it.
* [effectsync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectsync.md), [effectcancel](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/effectcancel.md) after it.

## Example

```lua
flash = function()
    npc.questeffectread(217);
    npc.effectreadsync();
    npc.effectplay(0);
    npc.effectsync();
end,
```

## Pitfalls

* Plays whatever the map left in slot 0 if the read was ignored.
