SetNpcArmor

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:55, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

setNpcArmor

Changes the authoritative armor of a resource-owned scripted NPC.

Syntax

bool setNpcArmor(int npcId, string itemKey)

Parameters

Name Type Required Description
npcId int yes The server-assigned NPC identifier returned by spawnNpc or getNpcs.
itemKey string yes A validated key returned by getPlayerArmorNames; armor and weapon accept none to clear the slot.

Returns

Returns true when the validated change is accepted and replicated; otherwise returns false.

Examples

Change an NPC's armor:

setNpcArmor(npcId, "none")

Notes

  • Available only in server-side resource scripts.
  • The state is sent reliably to current viewers and replayed on relevance entry and late join.
  • Raw Unreal object paths are never accepted from Lua.
  • Use getPlayerArmorNames to enumerate supported keys.