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

# npc.havegill

```lua
npc.havegill()
```

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

## What it does

Gives the party's gil. A result.

## Result

The gil, an integer.

## Timing

Returns at once.

## In NPC Kit

To the next call, `npc.gillwinopen(npc.havegill())`, or to Lua:

```lua
local tooPoor = [[
That's 100 gil, and I don't give tips on credit.
Come back when your purse feels a bit heavier.
]]

npc.lua(npc.havegill(), function(handle, gil)
    if gil < 100 then
        say(handle, tooPoor)
        return
    end
    -- ...
end);
```

## Used with

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

## Example

The result feeds the next call or Lua. Here both: the gil window shows the party's total, and Lua picks the line by it.

```lua
openGil = function()
    npc.gillwinopen(npc.havegill());       -- result straight into the next call
end,

talk = function()
    talkOpen();
    npc.lua(npc.havegill(), function(handle, gil)   -- result into Lua
        handle.run("openGil", function()
            say(handle, gil >= 1000 and "A rich one, I see." or "Times are hard, eh?",
                function() handle.run("closeGil", function() handle.finish() end) end)
        end)
    end);
    talkClose();
end,

closeGil = function()
    npc.gillwinclose();
end,
```

## Pitfalls

* The result goes only to the very next call, as its first argument; `npc.havegill() + 10` fails at `npc.add`.
