OnPlayerHeadChange
onPlayerHeadChange
Triggered after a validated independent Nameless Hero head option has changed.
Availability
This event is available in server-side scripts.
Callback signature
onPlayerHeadChange(playerId, previousHead, newHead, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
playerId |
int |
The affected connected player ID. |
previousHead |
string |
The previous stable head key. |
newHead |
string |
The new stable head key. |
sourceResource |
string |
The resource that requested the change. |
Examples
Handle the event:
addEventHandler("onPlayerHeadChange", root, function(playerId, previousHead, newHead, sourceResource)
outputDebugString(getPlayerName(playerId) .. " head: " .. previousHead .. " -> " .. newHead)
end)
Notes
- Independent head options are available only with the default editable player body.
- The corresponding reliable visual state is replayed during relevance entry and late join.