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

# npc.aask

```lua
npc.aask(slot, text, x, y, style)
```

|                         |                                                                         |
| ----------------------- | ----------------------------------------------------------------------- |
| id                      | `0x0010`                                                                |
| arguments               | 5: Int, Int, Int, Int, Int                                              |
| result                  | Int: goes to the very next call, or to `npc.lua(npc.aask(...), fn)`     |
| in NPC Kit              | yes                                                                     |
| measured from a kit NPC | returns                                                                 |
| waits                   | it has a wait handler: it can hold the script, and in `talk` the player |
| vanilla scripts         | 2327 calls in 183 of 1114 scripts                                       |

## What it does

The game's own question in a blue window at a screen position: shows line `text` of the script's text section with its choices, waits for the pick, and returns it.

## Arguments

### `slot` (Int)

The message window slot, 0 to 7.

### `text` (Int)

`0x01000000 + n`, a line of the running script's text section.

### `x` (Int)

### `y` (Int)

Where the window goes on screen.

### `style` (Int)

The window style, 1 to 4 (anything else is 0). Vanilla passes `1` or `4`.

## Result

The choice the player picked.

## Timing

Waits for the player's pick.

## In NPC Kit

**Use `dialog.aask` instead**: the kit's script has no text section. `dialog.aask` takes the text, the choices and `x`, `y`, `align` from Lua (`references/dialog.md`).

## Used with

* [askpos](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/askpos.md) before it in vanilla.
* [aaske](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/aaske.md): the conversation-window form.

## Example

The kit form of a vanilla `askpos` + `aask`: a menu with no speaker, centered on screen, the pick read in `onClose`.

```lua
local destination = [[
Where would you like to go from here, traveler?
Pick a place and I'll see that you get there.
]]

local destinationChoices = { "The Bazaar", "The Gate", "Stay here" }

talk = function()
    talkOpen();
    npc.lua(function(handle)
        if not dialog.aask.open {
                body = destination,
                choice = destinationChoices,
                cursor = 0,
                cancel = 2,                 -- Cancel lands on "Stay here"
                x = 960, y = 540, align = 4,
                queue = true,
                onClose = function(index, reason)
                    print("picked", reason == "dismissed" and index or "nothing")
                    handle.finish()
                end,
                onError = function() handle.finish() end
            } then
            handle.finish()
        end
    end);
    talkClose();
end,
```

## Pitfalls

* `npc.aask(...)` itself shows a line of the script's text section, which a kit NPC doesn't have.
* Every exit (`onClose`, `onError`, a refused `open`) must call `handle.finish()`, or the player stays in the talk.
