Skinner
Based on game build 714014 | Last updated: 2026-03-03
Overview
The skinner component handles character visual appearance in the game, including base skin selection, clothing items (body, hand, legs, feet), and skin type modes (e.g., normal_skin, wimpy_skin, ghost_skin, powerup). It coordinates with AnimState to apply skin and clothing overrides and syncs appearance data over the network via Network:SetPlayerSkin. It integrates closely with the beard component to synchronize beard skins.
Usage example
local inst = CreateEntity()
inst:AddComponent("skinner")
inst.components.skinner:SetSkinName("wx78_none")
inst.components.skinner:SetClothing("tundra_axe")
inst.components.skinner:SetSkinMode("normal_skin")
Dependencies & tags
Components used: beard (calls SetSkin and checks is_skinnable), Network, AnimState
Tags: None identified.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity instance | — | Reference to the entity owning this component. |
skin_name | string | "" | Name of the currently selected base skin prefab. |
clothing | table | { body = "", hand = "", legs = "", feet = "" } | Stores equipped clothing item names per slot. |
skintype | string | "normal_skin" | Current skin mode (e.g., "normal_skin", "ghost_skin", "powerup"). |
skin_data | table | {} | Skin definitions extracted from the selected skin prefab. |
monkey_curse | string or nil | nil | Monkey curse state (e.g., "MONKEY_CURSE_1"). |
Main functions
SetSkinName(skin_name, skip_beard_setup, skip_skins_set)
- Description: Sets the base skin by name, loads associated skin data, optionally updates linked beard skin, and reapplies full appearance.
- Parameters:
skin_name(string) — Name of the skin prefab (e.g.,"wx78_none"). If empty or invalid, defaults toprefab.."_none".
skip_beard_setup(boolean, optional) — Iftrue, skips beard skin synchronization.
skip_skins_set(boolean, optional) — Iftrue, skips reapplying skin/mode viaSetSkinMode. - Returns: Nothing.
- Error states: Emits an
"ERROR!!! Invisible werebeaver is probably about to happen!!!"message if nonormal_skinentry is found inskin_data.
SetSkinMode(skintype, default_build)
- Description: Switches the skin type mode (e.g., wimpy_skin, mighty_skin, ghost_skin) and reapplies all visual layers (base skin and clothing).
- Parameters:
skintype(string, optional) — Skin mode to apply. Defaults to currentself.skintype.
default_build(string, optional) — Fallback build name when no skin data exists. - Returns: Nothing.
- Notes: Also triggers
base_change_cbif defined and callsNetwork:SetPlayerSkinto sync appearance.
SetClothing(name)
- Description: Equips a named clothing item, determining its slot from
CLOTHING[name].type. - Parameters:
name(string) — Name of the clothing prefab to equip (e.g.,"tundra_axe"). - Returns: Nothing.
- Error states: Does nothing if
IsValidClothing(name)returnsfalse.
GetClothing()
- Description: Returns a summary of current skin and clothing state.
- Returns:
{
base = string, -- current skin_name
body = string, -- body slot
hand = string, -- hand slot
legs = string, -- legs slot
feet = string, -- feet slot
}
SetSkinMode(skintype, default_build)
- Description: Switches the skin type mode (e.g., wimpy_skin, mighty_skin, ghost_skin) and reapplies all visual layers (base skin and clothing).
- Parameters:
skintype(string, optional) — Skin mode to apply. Defaults to currentself.skintype.
default_build(string, optional) — Fallback build name when no skin data exists. - Returns: Nothing.
- Notes: Also triggers
base_change_cbif defined and callsNetwork:SetPlayerSkinto sync appearance.
SetMonkeyCurse(monkey_curse)
- Description: Sets or updates the monkey curse state and reapplies skin/appearance.
- Parameters:
monkey_curse(string ornil) — Monkey curse identifier (e.g.,"MONKEY_CURSE_3"), ornilto clear. - Returns: Nothing.
ClearMonkeyCurse()
- Description: Clears the monkey curse state and reapplies skin/appearance.
- Parameters: None.
- Returns: Nothing.
ClearAllClothing()
- Description: Removes all clothing items from all slots and reapplies appearance.
- Parameters: None.
- Returns: Nothing.
ClearClothing(type)
- Description: Removes clothing from a specific slot (
"body","hand","legs","feet") and reapplies appearance. - Parameters:
type(string) — Clothing slot to clear (e.g.,"body"). - Returns: Nothing.
HideAllClothing(anim_state)
- Description: Removes all clothing symbol overrides from the provided
AnimStatewithout modifying internal clothing state. - Parameters:
anim_state(table) —AnimStateinstance to modify. - Returns: Nothing.
CopySkinsFromPlayer(player)
- Description: Copies all visual skin and clothing data from another player entity to this one (e.g., for duplicates or previews).
- Parameters:
player(Entity) — Source entity with askinnercomponent. - Returns: Nothing.
OnSave()
- Description: Serializes current skin and clothing state for persistence.
- Returns:
{
skin_name = string,
clothing = table,
monkey_curse = string or nil,
skin_mode = string
}
OnLoad(data)
- Description: Restores skin and clothing state from
OnSavedata. Validates ownership during gameplay. - Parameters:
data(table) — Serialized skin/clothing state fromOnSave(). - Returns: Nothing.
- Notes: Skips validation during snapshot loading. Clears clothing if ownership is lost.
GetSkinMode()
- Description: Returns the current skin mode (
skintype). - Returns: string — Current skin type (e.g.,
"normal_skin").
HasSpinnableTail()
- Description: Determines whether the entity’s tail is spinnable based on skin and clothing choices.
- Parameters: None.
- Returns: boolean —
trueif tail is spinnable,falseotherwise. - Notes: Includes heuristic checks for
wortoxprefabs and clothing symbols.
Events & listeners
- Pushes:
"equipskinneditem"— Fired when a new clothing item is equipped (includes item name)."unequipskinneditem"— Fired when clothing is unequipped (includes old item name).
- Listens to: None identified.