SetPlayerHead
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
Headoption 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
onPlayerHeadChangewhen accepted.