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

# npc.setaskselectignore

```lua
npc.setaskselectignore(slot, choice)
```

|                         |                                 |
| ----------------------- | ------------------------------- |
| id                      | `0x0475`                        |
| arguments               | 2: Int, Int                     |
| in NPC Kit              | yes                             |
| measured from a kit NPC | returns                         |
| vanilla scripts         | 219 calls in 95 of 1114 scripts |

## What it does

Leaves choice `n` out of window `slot`'s next choice list.

## Arguments

### `slot` (Int)

The window slot, 0 to 7.

### `choice` (Int)

The choice to hide, from 0.

## Timing

Returns at once.

## In NPC Kit

**Use the `hidden` field of `dialog.aaske` / `dialog.aask`** (0-based indices) for the kit's windows (`references/dialog.md`, The fields a talk uses), or just build the `choice` list in Lua without it.

## Used with

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

## Example

The kit form of `setaskselectignore(0, 1)`: the second choice is left out until the player has the item. The count is read with `npc.lua`, the list built in Lua.

```lua
local reason = [[
What brings you here, traveler? Business, or not?
Few people come this far without a good reason.
]]

local reasonChoices = { "Just looking", "Sell a potion", "Goodbye" }

talk = function()
    talkOpen();
    npc.lua(npc.haveitem(0x0000), function(handle, potions)
        if not dialog.aaske.open {
                speaker = "NPCKit 0020",
                body = reason,
                choice = reasonChoices,
                hidden = potions == 0 and { 1 } or nil,
                cancel = 2,
                queue = true,
                onClose = function() handle.finish() end,
                onError = function() handle.finish() end
            } then
            handle.finish()
        end
    end);
    talkClose();
end,
```

## Pitfalls

* `cursor`, `cancel` and `hidden` count the full list: a hidden choice keeps its index.
