SetNpcArmorUpgrades
Jump to navigation
Jump to search
setNpcArmorUpgrades
AVAILABLE FROM UPDATE 0.1.9
Available from 0.1.9.
Replaces all three selected armor-upgrade slots for a resource-owned NPC.
Syntax
accepted = setNpcArmorUpgrades(npcId, parts)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
number |
yes | Existing scripted human NPC ID: finite integer 1..4294967295, not a numeric string. |
parts |
table |
yes | String keys top/mid/bottom only, with compatible part-key string values. Omitted slots, empty strings or none clear a slot. {} clears all parts. |
Returns
Boolean: true when accepted; false for invalid arguments/selection, unavailable character, wrong family/slot, or failed ownership/requirements. Invalid selections are rejected before equipment mutation.
Examples
-- NPC already wears mercenary and belongs to this resource.
local presets = getArmorUpgradePresets("mercenary")
if presets and presets.heavy_2 then
assert(setNpcArmorUpgrades(npcId, presets.heavy_2))
end
Notes
- Server-side only; available from 0.1.9.
- See Armor upgrades, Armor catalog and Armor upgrade catalog.
- Only the resource owning the NPC may change its parts. No player-inventory or player-requirement check is applied to NPCs.
- Uses the already equipped base; never selects a different base. The part must match its family and slot.
- true confirms server acceptance, not completed native rendering. No automatic healing/refill or database save.
- Treat remote requests as untrusted; authorize the action in your server resource.
- This is replacement, NOT a partial patch. Read the current table and modify one field to preserve the other slots. Values are keys, not item IDs; unknown table fields and non-string values reject the request.
- Equivalent alias: SetNpcArmorUpgrades.