SetPlayerSkin: Difference between revisions
Jump to navigation
Jump to search
Complete Lua function catalog |
Document Protocol 23 voice and player presentation APIs |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<!-- This page is generated automatically from the function definition: setPlayerSkin. --> | <!-- This page is generated automatically from the function definition: setPlayerSkin. --> | ||
= setPlayerSkin = | = setPlayerSkin = | ||
Changes a player's authoritative | Changes a player's authoritative legacy skin-surface preset. | ||
== Syntax == | == Syntax == | ||
| Line 21: | Line 21: | ||
== Examples == | == Examples == | ||
Apply | Apply a validated skin-surface preset: | ||
<syntaxhighlight lang="lua" line> | <syntaxhighlight lang="lua" line> | ||
if not setPlayerSkin(playerId, " | if not setPlayerSkin(playerId, "cor_kalom") then | ||
outputChatBox("The selected skin is unavailable.", playerId) | outputChatBox("The selected skin is unavailable.", playerId) | ||
end | end | ||
| Line 30: | Line 30: | ||
== Notes == | == Notes == | ||
* Available only in server-side resource scripts. | * Available only in server-side resource scripts. | ||
* | * This is the compatibility channel for Mutable skin, tattoo and scar data. It is separate from the identity and armor state. | ||
* The reliable state is sent immediately to relevant players and replayed during late join and relevance entry. | * The reliable state is sent immediately to relevant players and replayed during late join and relevance entry. | ||
* This emits <code>onPlayerSkinChange</code> when accepted. | * This emits <code>onPlayerSkinChange</code> when accepted. | ||
Latest revision as of 06:13, 24 August 2026
setPlayerSkin
Changes a player's authoritative legacy skin-surface preset.
Syntax
bool setPlayerSkin(int playerId, string skinKey)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
skinKey |
string |
yes | A stable key returned by getPlayerSkinNames.
|
Returns
Returns true when the validated preset is accepted and replicated; otherwise returns false.
Examples
Apply a validated skin-surface preset:
if not setPlayerSkin(playerId, "cor_kalom") then
outputChatBox("The selected skin is unavailable.", playerId)
end
Notes
- Available only in server-side resource scripts.
- This is the compatibility channel for Mutable skin, tattoo and scar data. It is separate from the identity and armor state.
- The reliable state is sent immediately to relevant players and replayed during late join and relevance entry.
- This emits
onPlayerSkinChangewhen accepted. - See Player skin catalog for every currently supported key.