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

# npc.nowjumpindex

```lua
npc.nowjumpindex()
```

|                         |                                                                          |
| ----------------------- | ------------------------------------------------------------------------ |
| id                      | `0x0091`                                                                 |
| arguments               | 0                                                                        |
| result                  | Int: goes to the very next call, or to `npc.lua(npc.nowjumpindex(), fn)` |
| in NPC Kit              | yes                                                                      |
| measured from a kit NPC | returns                                                                  |
| vanilla scripts         | 7673 calls in 530 of 1114 scripts                                        |

## What it does

Gives the entrance the party came onto the map by. A result.

## Result

The entrance index.

## Timing

Returns at once.

## In NPC Kit

Read it in Lua (`npc.lua(npc.nowjumpindex(), fn)`) to react to where the player came in; vanilla tests it in `if`s, which a recorded script can't hold.

## Used with

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

## Example

A guard whose greeting depends on the entrance the party came in by.

```lua
talk = function()
    talkOpen();
    npc.lua(npc.nowjumpindex(), function(handle, entrance)
        say(handle, entrance == 0 and "Back from the desert?" or "Welcome to the city.")
    end);
    talkClose();
end,
```

## Pitfalls

* Which index is which entrance is the map's own: print it once to find out.
