SetPlayerHead

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

setPlayerHead

Changes a player's independent Nameless Hero head option.

Syntax

bool setPlayerHead(int playerId, string headKey)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
headKey string yes A stable key returned by getPlayerHeadNames.

Returns

Returns true when the compatible head is accepted and replicated; otherwise returns false.

Examples

Select the second editable head:

setPlayerBody(playerId, "default")
if not setPlayerHead(playerId, "head_02") then
    outputChatBox("The head option could not be applied.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • This API writes the validated Mutable Head option and never accepts raw Unreal paths.
  • A non-default head is rejected while a named full-body preset is active.
  • The reliable state is replayed during relevance entry and late join.
  • This emits onPlayerHeadChange when accepted.