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

# npc.getsaveindex

```lua
npc.getsaveindex()
```

|                         |                                                                          |
| ----------------------- | ------------------------------------------------------------------------ |
| id                      | `0x032E`                                                                 |
| arguments               | 0                                                                        |
| result                  | int: goes to the very next call, or to `npc.lua(npc.getsaveindex(), fn)` |
| in NPC Kit              | yes                                                                      |
| measured from a kit NPC | returns                                                                  |
| vanilla scripts         | 90 calls in 81 of 1114 scripts                                           |

## What it does

Gives the entrance index the current map's own script names as its save entrance. A result. Vanilla save crystals compare it with [nowjumpindex](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/nowjumpindex.md): equal means the party came in by loading a save there.

## Result

The entrance index.

## Timing

Returns at once.

## Used with

* [nowjumpindex](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/nowjumpindex.md).

## Example

```lua
local rest = [[
This is a safe place to rest, traveler, so stay.
The crystal keeps the monsters far from here.
]]

talk = function()
    talkOpen();
    npc.lua(npc.getsaveindex(), function(handle, entrance)
        print("save entrance", entrance)
        say(handle, rest)
    end);
    talkClose();
end,
```
