OnPlayerSkinChange

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:49, 15 August 2026 by QCherry (talk | contribs) (Update Lua event reference)
(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

  • The skin represents one validated body-and-face CharacterDefinition preset; armor remains separate.
  • The corresponding visual state is reliably synchronized and replayed to late joiners.