PUBLIC LUA EXAMPLES

GTA V Lua Coordinate Notebook

Download a Nenyoo Lua example that reads your position and heading, prints a reusable coordinate table and keeps the last capture until the script is unloaded.

GTA V PremiumNative Engine + Foundation APINenyoo documentation examples

What this example does

Capture position reads your current player coordinates and heading when the action runs. It prints a Lua-style table suitable for recording a location while developing.

self.pos returns x, y and z separately. self.heading returns degrees. string.format keeps three decimal places for position and two for heading.

The last capture is stored in a local variable. Print last capture repeats it without reading a new position. No teleport, game-state write or file write is performed.

Install and run

  1. Use Nenyoo GTA V Premium with the native Lua API. Download the file and keep its .lua extension.
  2. Put nenyoo-coordinate-notebook.lua in the native user-script folder:%LOCALAPPDATA%\Nenyoo\Plus\Scripts\User\
  3. Refresh the script list, load the script, and open its script page. Keep the -- @nenyoo-menu marker at the top.
  4. Use the script’s Unload action when finished. Reload after editing its source.

Try it

  1. Load into the game with your character present, then choose Capture position.
  2. Open F10 and record the printed coordinate table.
  3. Move somewhere else, then use Print last capture to repeat the old location or Capture position to replace it.

Complete Lua source

nenyoo-coordinate-notebook.lua · original Nenyoo documentation example

-- @nenyoo-menu -- Nenyoo documentation example: coordinate notebook. -- Requires GTA V Premium's native Engine + Foundation Lua APIs. -- Source review only; no in-game compatibility claim. -- Read-only position utility: use after your character has loaded. local root = menu.my_root() local last_capture = nil menu.action(root, "Capture position", {}, "Print coordinates and heading to the Lua console", function() local x, y, z = self.pos() local heading = self.heading() last_capture = string.format("{ x = %.3f, y = %.3f, z = %.3f, heading = %.2f }", x, y, z, heading) print("Coordinate notebook: " .. last_capture) util.toast("Position captured. Open F10 to read the coordinates.") end) menu.action(root, "Print last capture", {}, "Print the last capture again", function() if last_capture then print("Coordinate notebook: " .. last_capture) util.toast("Last capture printed to the Lua console.") else util.toast("Capture a position first.") end end) menu.action(root, "Clear capture", {}, "Discard the local capture", function() last_capture = nil util.toast("Capture cleared.") end)

Requirements and limits

  • Wait until your character is loaded. The underlying position API returns zero coordinates when no player ped is available.
  • The capture is held only in Lua memory. Save the printed text yourself before reloading or unloading.
  • This example provides a point and heading, not an interior identifier, map conversion or teleport compatibility guarantee.

API and source review: 2026-11-13. These examples were reviewed against the bundled Nenyoo reference and source. They have not been tested in a running game, and no particular game-build compatibility is claimed.

APIs used: menu.my_root, menu.action, self.pos, self.heading, util.toast

More Lua examples