OnPlayerSkinChange

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 18:58, 15 August 2026 by QCherry (talk | contribs) (Document player appearance change events)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onPlayerSkinChange

Triggered after a validated authoritative player appearance preset has changed.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerSkinChange(playerId, previousSkin, newSkin, sourceResource)

Parameters

Name Type Description
playerId int The affected connected player ID.
previousSkin string The previous stable skin key.
newSkin string The new stable skin key.
sourceResource string The resource that requested the change.

Examples

Handle the event:

addEventHandler("onPlayerSkinChange", root, function(playerId, previousSkin, newSkin, sourceResource)
    outputDebugString(getPlayerName(playerId) .. " skin: " .. previousSkin .. " -> " .. newSkin)
end)

Notes

  • For players this compatibility event reports the Mutable skin-surface preset; authoritative body and head changes have separate events.
  • The corresponding visual state is reliably synchronized and replayed to late joiners.