GetNpcSpell
getNpcSpell
AVAILABLE FROM UPDATE 0.1.5
This function is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.
Reads the NPC selected spell key.
Syntax
getNpcSpell(npcId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
int |
yes | Server-assigned NPC ID returned by spawnNpc; not a player ID. |
Returns
Returns the selected spell key, none when empty, or false for an unavailable NPC.
Examples
local spell = getNpcSpell(npcId)
Notes
- Server-side only. Mutations require the NPC to belong to the calling resource; getters do not grant control.
- Since 0.1.5. This documents the next release; public 0.1.4 does not include these additions.
- Use matching updated client and server. See NPC scripting for lifecycle, defaults, combat examples and collision limitations.
- Does not return the charge level.