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

# npc.fadeout

```lua
npc.fadeout(frames)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x00B6`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 4391 calls in 818 of 1114 scripts |

## What it does

Fades the screen out to black over a number of frames. [fadesync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadesync.md) waits for the fade. The colour is always black; the draw stage is the one [fadelayer](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadelayer.md) set, or `6`.

## Arguments

### `frames` (Int)

How long. Vanilla: `15` (1,660 calls), `1`, `0`, `10`, `8`, `30`.

## Timing

Returns at once; the fade runs over the frames.

## In NPC Kit

A scene's `open` and `close` set the stage in the black:

```lua
npc.fadeout(15);
npc.fadesync();
-- move actors, cut the camera, hide or show
npc.wait(3);
npc.fadein(15);
npc.fadesync();
```

## Used with

* [fadesync](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadesync.md) right after, [fadein](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadein.md) to come back.
* `references/scenes.md`, Open and close, in the black.

## Example

A scene's `close`: everything goes back in the black, so the scene can play again.

```lua
close = function()
    npc.fadeout(15);
    npc.fadesync();
    npc.cameraclear();
    local guest = npc.on("npckit_0022")
    guest.setpos2(316.223, 2.022, 42.774);
    guest.dir(1.675);
    guest.hide();
    guest.hideshadow();
    npc.wait(3);
    npc.fadein(15);
    npc.fadesync();
end,
```

## Pitfalls

* A `fadeout` with no `fadein` leaves the screen black after the talk.
