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

# npc.additemmes

```lua
npc.additemmes(item, count)
```

|                         |                                                                           |
| ----------------------- | ------------------------------------------------------------------------- |
| id                      | `0x0480`                                                                  |
| arguments               | 2: Int, Int                                                               |
| result                  | int: goes to the very next call, or to `npc.lua(npc.additemmes(...), fn)` |
| in NPC Kit              | yes                                                                       |
| measured from a kit NPC | waits: holds the script until its condition holds                         |
| vanilla scripts         | 4364 calls in 376 of 1114 scripts                                         |

## What it does

Shows the game's "obtained" notice for an item, waits for the player to close it, then gives the item. It gives the item; it doesn't only show the notice.

## Arguments

### `item` (Int)

The id (`data/inv-*.csv`), class in the top nibble: `0x0000+` items, `0x1000+` equipment, `0x2000+` loot, `0x3000+` magicks, `0x4000+` technicks, `0x8000+` key items, `0xE000+` gil.

### `count` (Int)

How many.

## Timing

Waits while the notice is up; in a talk the player closes it.

## In NPC Kit

In a named function run from the talk's Lua with `handle.run`, inside vanilla's framing (music down, time stopped, blur): `giveItem` in `references/talks.md`, Giving an item.

From Lua, `dialog.additemmes.open { content = id, count = n }` gives an item with the same notice.

## Used with

* [sebsoundplay](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/sebsoundplay.md)`(0, 40)`, [musictrans](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/musictrans.md), [seteventtimestop](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/seteventtimestop.md), the `moveblur*` calls: vanilla's framing.
* [haveitem](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/haveitem.md): check first.
* [additem](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/additem.md): no notice.

## Example

An item given with the game's notice, framed as vanilla frames it (music down, time stopped, blur, jingle), then a line once the player closes the notice.

```lua
local farewell = [[
May it serve you well on the road ahead of you.
Come back and tell me all about your travels.
]]

give = function()
    npc.musictrans(-1, 30, 32);
    npc.setstatuserrorctrldenystatus_by_menu(1);
    npc.seteventtimestop(1);
    npc.moveblurcaptureonce();
    npc.movebluraplpha(1);
    npc.moveblurfade(15);
    npc.moveblurfadesync();
    npc.sebsoundplay(0, 40);
    npc.additemmes(0x0000, 1);          -- Potion; waits for the player to close the notice
    npc.musictrans(-1, 30, 127);
    npc.moveblurclearfade(15);
    npc.moveblurfadesync();
    npc.seteventtimestop(0);
    npc.setstatuserrorctrldenystatus_by_menu(0);
end,

talk = function()
    talkOpen();
    npc.lua(function(handle)
        handle.run("give", function() say(handle, farewell) end)
    end);
    talkClose();
end,
```

## Pitfalls

* It gives the item; don't add an `additem` for the same thing.
* It waits for the notice: it belongs in a named function `handle.run` runs, not in `npc.lua`.
