OnNpcAppearanceChange
Jump to navigation
Jump to search
onNpcAppearanceChange
Triggered after a scripted NPC's skin or armor changes.
Availability
This event is available in server-side scripts.
Callback signature
onNpcAppearanceChange(npcId, field, previousValue, newValue, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
npcId |
int |
The affected NPC identifier. |
field |
string |
Either skin or armor. |
previousValue |
string |
The previous stable catalog key. |
newValue |
string |
The new stable catalog key. |
sourceResource |
string |
The resource that requested the change. |
Examples
Handle the event:
addEventHandler("onNpcAppearanceChange", root, function(npcId, field, previousValue, newValue, sourceResource)
outputDebugString("NPC " .. npcId .. " " .. field .. ": " .. previousValue .. " -> " .. newValue)
end)
Notes
- This is an observation event; the authoritative state has already changed.