OnPlayerBodyChange

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

onPlayerBodyChange

Triggered after a validated authoritative full-body identity preset has changed.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerBodyChange(playerId, previousBody, newBody, sourceResource)

Parameters

Name Type Description
playerId int The affected connected player ID.
previousBody string The previous stable body key.
newBody string The new stable body key.
sourceResource string The resource that requested the change.

Examples

Handle the event:

addEventHandler("onPlayerBodyChange", root, function(playerId, previousBody, newBody, sourceResource)
    outputDebugString(getPlayerName(playerId) .. " body: " .. previousBody .. " -> " .. newBody)
end)

Notes

  • Named body presets are complete prebaked G1R body-and-head meshes.
  • The corresponding reliable visual state is replayed during relevance entry and late join.