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

# npc.getx\_12b

```lua
npc.getx_12b(actor)
```

|                         |                                                                           |
| ----------------------- | ------------------------------------------------------------------------- |
| id                      | `0x012B`                                                                  |
| arguments               | 1: Int                                                                    |
| result                  | float: goes to the very next call, or to `npc.lua(npc.getx_12b(...), fn)` |
| in NPC Kit              | yes                                                                       |
| measured from a kit NPC | returns                                                                   |
| vanilla scripts         | 616 calls in 134 of 1114 scripts                                          |

## What it does

Gives the x position of another actor; `0` for an index with no actor. A result.

## Arguments

### `actor` (Int)

`-1` the character the player controls (285 of 551 vanilla calls); in the kit another NPC with `npc.actor("id")` (in a talk).

## Result

The x, a float.

## Timing

Returns at once.

## In NPC Kit

Only to the next call or `npc.lua` (cut to an integer there). The player's position can't be known when `npc.add` runs, so a point relative to the player isn't available in a recorded script.

## Used with

* [getz\_12d](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/getz_12d.md), [distance\_290](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/distance_290.md).

## Example

The player's x read in a talk, rounded, to pick a line by which side of the plaza they stand on.

```lua
talk = function()
    talkOpen();
    npc.lua(npc.getx_12b(-1), function(handle, x)
        say(handle, x < 30 and "The west gate is behind you." or "The west gate is that way.")
    end);
    talkClose();
end,
```

## Pitfalls

* The value arrives cut to an integer: good for a side or a zone, not for a point.
