SetPlayerSkin: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Update Lua API reference
 
Complete Lua function catalog
Line 35: Line 35:
* See [[Player skin catalog]] for every currently supported key.
* See [[Player skin catalog]] for every currently supported key.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Player Functions]]
[[Category:Player Functions]]
[[Category:Appearance Functions]]
[[Category:Appearance Functions]]

Revision as of 09:55, 15 August 2026

setPlayerSkin

Changes a player's authoritative body-and-face appearance 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 Milten's validated human appearance preset:

if not setPlayerSkin(playerId, "milten") then
    outputChatBox("The selected skin is unavailable.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • The body and face are changed together because G1R validates them through one CharacterDefinition and Mutable generation chain.
  • The reliable state is sent immediately to relevant players and replayed during late join and relevance entry.
  • This emits onPlayerSkinChange when accepted.
  • See Player skin catalog for every currently supported key.