NPC
The NPC object represents an NPC entity in the game world.
Functions
npc:is_valid() -> boolean
Validates the object exists in the game world. Always call this before using other methods.
npc:get_id() -> number
Returns the NPC template ID.
npc:get_position() -> table
Returns position as a table with x and y fields.
lua
local pos = npc:get_position()
-- pos.x, pos.ynpc:get_name() -> string
Returns the NPC name.