OnPlayerSkinChange: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Update Lua event reference
 
Document player appearance change events
 
Line 33: Line 33:


== Notes ==
== Notes ==
* The skin represents one validated body-and-face CharacterDefinition preset; armor remains separate.
* 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.
* The corresponding visual state is reliably synchronized and replayed to late joiners.



Latest revision as of 18:58, 15 August 2026

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.