FrameworkZ API - CHARACTER
CHARACTER
Character class for FrameworkZ.
0
Functions
117
Methods
1
Fields
📋 On This Page
- Overview
- Statistics
- Fields1
- Methods117
- CHARACTER:AddRecognition
- CHARACTER:Destroy
- CHARACTER:GetAge
- CHARACTER:GetAllHealth
- CHARACTER:GetBeardColor
- CHARACTER:GetBeardStyle
- CHARACTER:GetBodyParts
- CHARACTER:GetBoredom
- CHARACTER:GetColdStrength
- CHARACTER:GetDescription
- CHARACTER:GetDrunkenness
- CHARACTER:GetEndurance
- CHARACTER:GetEquipment
- CHARACTER:GetEyeColor
- CHARACTER:GetFaction
- CHARACTER:GetFatigue
- CHARACTER:GetGender
- CHARACTER:GetHairColor
- CHARACTER:GetHairStyle
- CHARACTER:GetHasCold
- CHARACTER:GetHealth
- CHARACTER:GetHeight
- CHARACTER:GetHunger
- CHARACTER:GetID
- CHARACTER:GetInventory
- CHARACTER:GetInventoryContents
- CHARACTER:GetInventoryID
- CHARACTER:GetIsoPlayer
- CHARACTER:GetName
- CHARACTER:GetPain
- CHARACTER:GetPanic
- CHARACTER:GetPerks
- CHARACTER:GetPhysique
- CHARACTER:GetPlayer
- CHARACTER:GetPosition
- CHARACTER:GetRecognition
- CHARACTER:GetRecognizes
- CHARACTER:GetSaveableData
- CHARACTER:GetSickness
- CHARACTER:GetSkills
- CHARACTER:GetSkinColor
- CHARACTER:GetStats
- CHARACTER:GetStress
- CHARACTER:GetTemperature
- CHARACTER:GetThirst
- CHARACTER:GetTraits
- CHARACTER:GetUID
- CHARACTER:GetUsername
- CHARACTER:GetWeight
- CHARACTER:GetWetness
- CHARACTER:GiveItem
- CHARACTER:GiveItems
- CHARACTER:Initialize
- CHARACTER:InitializeDefaultItems
- CHARACTER:IsCitizen
- CHARACTER:IsCombine
- CHARACTER:OnLoad
- CHARACTER:OnPostLoad
- CHARACTER:OnPreLoad
- CHARACTER:RecognizesCharacter
- CHARACTER:Restore
- CHARACTER:RestoreData
- CHARACTER:RestoreEquipment
- CHARACTER:RestoreHealth
- CHARACTER:RestoreInventory
- CHARACTER:RestoreModel
- CHARACTER:RestorePosition
- CHARACTER:RestoreSkills
- CHARACTER:RestoreStats
- CHARACTER:RestoreTraits
- CHARACTER:Save
- CHARACTER:SetAge
- CHARACTER:SetBeardColor
- CHARACTER:SetBeardStyle
- CHARACTER:SetBodyParts
- CHARACTER:SetBoredom
- CHARACTER:SetColdStrength
- CHARACTER:SetDescription
- CHARACTER:SetDrunkenness
- CHARACTER:SetEndurance
- CHARACTER:SetEquipment
- CHARACTER:SetEyeColor
- CHARACTER:SetFaction
- CHARACTER:SetFatigue
- CHARACTER:SetGender
- CHARACTER:SetHairColor
- CHARACTER:SetHairStyle
- CHARACTER:SetHasCold
- CHARACTER:SetHealth
- CHARACTER:SetHeight
- CHARACTER:SetHunger
- CHARACTER:SetID
- CHARACTER:SetInventory
- CHARACTER:SetInventoryID
- CHARACTER:SetIsoPlayer
- CHARACTER:SetName
- CHARACTER:SetPain
- CHARACTER:SetPanic
- CHARACTER:SetPerks
- CHARACTER:SetPhysique
- CHARACTER:SetPlayer
- CHARACTER:SetRecognizes
- CHARACTER:SetSickness
- CHARACTER:SetSkills
- CHARACTER:SetSkinColor
- CHARACTER:SetStress
- CHARACTER:SetTemperature
- CHARACTER:SetThirst
- CHARACTER:SetTraits
- CHARACTER:SetUID
- CHARACTER:SetUsername
- CHARACTER:SetWeight
- CHARACTER:SetWetness
- CHARACTER:Sync
- CHARACTER:TakeItem
- CHARACTER:TakeItemByInstanceID
- CHARACTER:TakeItems
Fields
1
CHARACTER
📋 table
Character class for FrameworkZ.
Initial value:
{}Methods
117CHARACTER:AddRecognition(character, alias)
method
Add a character to the recognition list.
Parameters
character
📋 table
The character object to add to recognition.
alias
📝 string
(Optional) The alias to recognize the character as.
Returns
✅ boolean
\string Whether the recognition was successfully added and a message.
CHARACTER:Destroy()
method
Destroy a character. This will remove the character from the list of characters and is usually called after a player has disconnected.
CHARACTER:GetAge()
method
Get the character's age.
Returns
🔢 integer
The character's age.
CHARACTER:GetAllHealth()
method
Get and sync all character health data from isoPlayer.
Returns
📋 table
The character's health data.
CHARACTER:GetBeardColor()
method
Get the character's beard color.
Returns
📋 table
The character's beard color as RGB values.
CHARACTER:GetBeardStyle()
method
Get the character's beard style.
Returns
📝 string
The character's beard style.
CHARACTER:GetBodyParts()
method
Get the character's body part data.
Returns
📋 table
The character's body part data.
CHARACTER:GetBoredom()
method
Get the character's boredom stat.
Returns
🔢 number
The character's boredom level.
CHARACTER:GetColdStrength()
method
Get the character's cold strength.
Returns
🔢 number
The character's cold strength.
CHARACTER:GetDescription()
method
Get the character's description.
Returns
📝 string
The character's description.
CHARACTER:GetDrunkenness()
method
Get the character's drunkenness stat.
Returns
🔢 number
The character's drunkenness level.
CHARACTER:GetEndurance()
method
Get the character's endurance stat.
Returns
🔢 number
The character's endurance level.
CHARACTER:GetEquipment()
method
Get and sync character equipment from isoPlayer.
Only extracts equipment slots (Hat, Shirt, Pants, etc.), not inventory contents.
Returns
📋 table
The character's equipment data by slot.
CHARACTER:GetEyeColor()
method
Get the character's eye color.
Returns
📋 table
The character's eye color as RGB values.
CHARACTER:GetFaction()
method
Get the character's faction.
Returns
📝 string
The character's faction ID.
CHARACTER:GetFatigue()
method
Get the character's fatigue stat.
Returns
🔢 number
The character's fatigue level.
CHARACTER:GetGender()
method
Get the character's gender.
Returns
📝 string
The character's gender.
CHARACTER:GetHairColor()
method
Get the character's hair color.
Returns
📋 table
The character's hair color as RGB values.
CHARACTER:GetHairStyle()
method
Get the character's hair style.
Returns
📝 string
The character's hair style.
CHARACTER:GetHasCold()
method
Get whether the character has a cold.
Returns
✅ boolean
Whether the character has a cold.
CHARACTER:GetHealth()
method
Get the character's overall body health.
Returns
🔢 number
The character's overall body health.
CHARACTER:GetHeight()
method
Get the character's height.
Returns
🔢 number
The character's height.
CHARACTER:GetHunger()
method
Get the character's hunger stat.
Returns
🔢 number
The character's hunger level.
CHARACTER:GetID()
method
Get the character's ID.
Returns
🔢 integer
The character's ID.
CHARACTER:GetInventory()
method
Get the character's inventory object.
Returns
📋 table
The character's inventory object.
CHARACTER:GetInventoryContents()
method
Get and sync inventory contents from the character's Inventory object.
Delegates to the Inventory object's Save() method.
Returns
📋 table
The inventory contents data with INVENTORY_LOGICAL and INVENTORY_PHYSICAL.
CHARACTER:GetInventoryID()
method
Get the character's inventory ID.
Returns
🔢 integer
The character's inventory ID.
CHARACTER:GetIsoPlayer()
method
Get the character's IsoPlayer object.
Returns
📋 table
The character's IsoPlayer object.
CHARACTER:GetName()
method
Get the character's name.
Returns
📝 string
The character's name.
CHARACTER:GetPain()
method
Get the character's pain stat.
Returns
🔢 number
The character's pain level.
CHARACTER:GetPanic()
method
Get the character's panic stat.
Returns
🔢 number
The character's panic level.
CHARACTER:GetPerks()
method
Get the character's perks (same as traits in PZ).
Returns
📋 table
The character's perks.
CHARACTER:GetPhysique()
method
Get the character's physique.
Returns
📝 string
The character's physique.
CHARACTER:GetPlayer()
method
Get the character's associated player object.
Returns
📋 table
The character's player object.
CHARACTER:GetPosition()
method
Get and sync character position and direction from isoPlayer.
Returns
📋 table
The character's position data.
CHARACTER:GetRecognition(character)
method
Get how this character recognizes another character.
Parameters
character
📋 table
The character object to get recognition for.
Returns
📝 string
The name or alias this character recognizes the other as.
CHARACTER:GetRecognizes()
method
Get the character's recognition list.
Returns
📋 table
The character's recognition list.
CHARACTER:GetSaveableData()
method
Get the character's saveable data with filtered properties.
Returns
📋 table
The character's saveable data.
CHARACTER:GetSickness()
method
Get the character's sickness level.
Returns
🔢 number
The character's sickness level.
CHARACTER:GetSkills()
method
Get the character's skills/XP data.
Returns
📋 table
The character's skills data.
CHARACTER:GetSkinColor()
method
Get the character's skin color.
Returns
🔢 integer
The character's skin color constant.
CHARACTER:GetStats()
method
Get and sync all character stats from isoPlayer.
Returns
📋 table
The character's stats data.
CHARACTER:GetStress()
method
Get the character's stress stat.
Returns
🔢 number
The character's stress level.
CHARACTER:GetTemperature()
method
Get the character's body temperature.
Returns
🔢 number
The character's body temperature.
CHARACTER:GetThirst()
method
Get the character's thirst stat.
Returns
🔢 number
The character's thirst level.
CHARACTER:GetTraits()
method
Get the character's traits.
Returns
📋 table
The character's traits.
CHARACTER:GetUID()
method
Get the character's unique ID.
Returns
📝 string
The character's unique ID.
CHARACTER:GetUsername()
method
Get the character's username.
Returns
📝 string
The character's username.
CHARACTER:GetWeight()
method
Get the character's weight.
Returns
🔢 number
The character's weight.
CHARACTER:GetWetness()
method
Get the character's wetness level.
Returns
🔢 number
The character's wetness level.
CHARACTER:GiveItem(uniqueID)
method
Give a character an item.
Parameters
uniqueID
📝 string
The ID of the item to give.
Returns
✅ boolean
Whether or not the item was successfully given.
CHARACTER:GiveItems(uniqueID, amount)
method
Give a character items by the specified amount.
Parameters
uniqueID
📝 string
The unique ID of the item to give.
amount
🔢 integer
The amount of the item to give.
CHARACTER:Initialize(callback)
method
Initialize a character.
Returns
✅ boolean
\string Whether initialization was successful and a message.
CHARACTER:InitializeDefaultItems()
method
Initialize the default items for a character based on their faction. Called when FZ_CHAR mod data is first created.
CHARACTER:IsCitizen()
method
Checks if a character is a citizen.
Returns
✅ boolean
Whether or not the character is a citizen.
CHARACTER:IsCombine()
method
Checks if a character is a combine.
Returns
✅ boolean
Whether or not the character is a combine.
CHARACTER:OnLoad()
method
Character load hook. Called during character loading.
CHARACTER:OnPostLoad(firstLoad)
method
Character post-load hook. Called after character loading is complete.
Parameters
firstLoad
✅ boolean
Whether this is the first time loading this character.
CHARACTER:OnPreLoad()
method
Character pre-load hook. Called before character loading begins.
CHARACTER:RecognizesCharacter(character)
method
Check if this character recognizes another character.
Parameters
character
📋 table
The character object to check recognition for.
Returns
✅ boolean
Whether this character recognizes the other character.
CHARACTER:Restore(callback)
method
Restore this character from persisted data and attach it to the owning player.
Parameters
callback
⚡ function
Callback(characterData|false, message) invoked when restore completes.
Returns
✅ boolean
Success flag.
📝 string
Status or error message.
CHARACTER:RestoreData(characterData)
method
Used for restoring character data from a table, typically a table gathered through the FZ Data Storage system.
Parameters
characterData
📋 table
(Optional) The character data table to restore from.
CHARACTER:RestoreEquipment(characterData)
method
Restore worn equipment from saved character data.
Parameters
characterData
📋 table
Character data payload containing equipment info.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestoreHealth(characterData)
method
Restore health values, environmental effects, and body part states.
Parameters
characterData
📋 table
Character data payload containing health fields/body part data.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestoreInventory(characterData)
method
Restore logical/physical inventory (not worn equipment) from saved character data.
Parameters
characterData
📋 table
Character data payload containing INVENTORY_LOGICAL and INVENTORY_PHYSICAL.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestoreModel(characterData, reset)
method
Restore visual model (gender, skin, hair, beard) from saved character data.
Parameters
characterData
📋 table
Character data payload used to rebuild visuals.
reset (optional)
✅ boolean
Whether to call isoPlayer:resetModel() after applying visuals.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestorePosition(x, y, z, angles)
method
Restore world position and facing direction.
Parameters
x
🔢 number
X coordinate.
y
🔢 number
Y coordinate.
z
🔢 number
Z level.
angles (optional)
🔢 number
Facing direction angle.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestoreSkills(characterData)
method
Restore skills/XP levels from saved data.
Parameters
characterData
📋 table
Character data payload containing XP/skills table.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestoreStats(characterData)
method
Restore high-level moodle/stat values (hunger, thirst, fatigue, etc.).
Parameters
characterData
📋 table
Character data payload containing STAT_* fields.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:RestoreTraits(characterData)
method
Restore trait list to the IsoPlayer and character object.
Parameters
characterData
📋 table
Character data payload containing trait array.
Returns
✅ boolean
Success flag.
📝 string
Descriptive message.
CHARACTER:Save(callback)
method
Save the character's data from the character object.
Parameters
callback
⚡ function
Optional callback function(success, message) called when save completes.
Returns
✅ boolean
Whether or not the character was successfully saved.
CHARACTER:SetAge(age)
method
Set the character's age.
Parameters
age
🔢 integer
The age to set.
CHARACTER:SetBeardColor(beardColor)
method
Set the character's beard color.
Parameters
beardColor
📋 table
The beard color to set as RGB values.
CHARACTER:SetBeardStyle(beardStyle)
method
Set the character's beard style.
Parameters
beardStyle
📝 string
The beard style to set.
CHARACTER:SetBodyParts(bodyParts)
method
Set the character's body part data.
Parameters
bodyParts
📋 table
The body part data to set.
CHARACTER:SetBoredom(boredom)
method
Set the character's boredom stat.
Parameters
boredom
🔢 number
The boredom level to set.
CHARACTER:SetColdStrength(coldStrength)
method
Set the character's cold strength.
Parameters
coldStrength
🔢 number
The cold strength to set.
CHARACTER:SetDescription(description)
method
Set the character's description.
Parameters
description
📝 string
The description to set.
CHARACTER:SetDrunkenness(drunkenness)
method
Set the character's drunkenness stat.
Parameters
drunkenness
🔢 number
The drunkenness level to set.
CHARACTER:SetEndurance(endurance)
method
Set the character's endurance stat.
Parameters
endurance
🔢 number
The endurance level to set.
CHARACTER:SetEquipment(equipment)
method
Set the character's equipment data.
Parameters
equipment
📋 table
The equipment data to set.
CHARACTER:SetEyeColor(eyeColor)
method
Set the character's eye color.
Parameters
eyeColor
📋 table
The eye color to set as RGB values.
CHARACTER:SetFaction(faction)
method
Set the character's faction.
Parameters
faction
📝 string
The faction ID to set.
CHARACTER:SetFatigue(fatigue)
method
Set the character's fatigue stat.
Parameters
fatigue
🔢 number
The fatigue level to set.
CHARACTER:SetGender(gender)
method
Set the character's gender.
Parameters
gender
📝 string
The gender to set.
CHARACTER:SetHairColor(hairColor)
method
Set the character's hair color.
Parameters
hairColor
📋 table
The hair color to set as RGB values.
CHARACTER:SetHairStyle(hairStyle)
method
Set the character's hair style.
Parameters
hairStyle
📝 string
The hair style to set.
CHARACTER:SetHasCold(hasCold)
method
Set whether the character has a cold.
Parameters
hasCold
✅ boolean
Whether the character has a cold.
CHARACTER:SetHealth(health)
method
Set the character's overall body health.
Parameters
health
🔢 number
The health level to set.
CHARACTER:SetHeight(height)
method
Set the character's height.
Parameters
height
🔢 number
The height to set.
CHARACTER:SetHunger(hunger)
method
Set the character's hunger stat.
Parameters
hunger
🔢 number
The hunger level to set.
CHARACTER:SetID(id)
method
Set the character's ID.
Parameters
id
🔢 integer
The ID to set.
CHARACTER:SetInventory(inventory)
method
Set the character's inventory object.
Parameters
inventory
📋 table
The inventory object to set.
CHARACTER:SetInventoryID(inventoryID)
method
Set the character's inventory ID.
Parameters
inventoryID
🔢 integer
The inventory ID to set.
CHARACTER:SetIsoPlayer(isoPlayer)
method
Set the character's IsoPlayer object (read-only).
Parameters
isoPlayer
📋 table
The IsoPlayer object (cannot be set after creation).
CHARACTER:SetName(name)
method
Set the character's name.
Parameters
name
📝 string
The name to set.
CHARACTER:SetPain(pain)
method
Set the character's pain stat.
Parameters
pain
🔢 number
The pain level to set.
CHARACTER:SetPanic(panic)
method
Set the character's panic stat.
Parameters
panic
🔢 number
The panic level to set.
CHARACTER:SetPerks(perks)
method
Set the character's perks (same as traits in PZ).
Parameters
perks
📋 table
The perks to set.
CHARACTER:SetPhysique(physique)
method
Set the character's physique.
Parameters
physique
📝 string
The physique to set.
CHARACTER:SetPlayer(player)
method
Set the character's associated player object.
Parameters
player
📋 table
The player object to set.
CHARACTER:SetRecognizes(recognizes)
method
Set the character's recognition list.
Parameters
recognizes
📋 table
The recognition list to set.
CHARACTER:SetSickness(sickness)
method
Set the character's sickness level.
Parameters
sickness
🔢 number
The sickness level to set.
CHARACTER:SetSkills(skills)
method
Set the character's skills/XP data.
Parameters
skills
📋 table
The skills data to set.
CHARACTER:SetSkinColor(skinColor)
method
Set the character's skin color.
Parameters
skinColor
🔢 integer
The skin color constant to set.
CHARACTER:SetStress(stress)
method
Set the character's stress stat.
Parameters
stress
🔢 number
The stress level to set.
CHARACTER:SetTemperature(temperature)
method
Set the character's body temperature.
Parameters
temperature
🔢 number
The temperature to set.
CHARACTER:SetThirst(thirst)
method
Set the character's thirst stat.
Parameters
thirst
🔢 number
The thirst level to set.
CHARACTER:SetTraits(traits)
method
Set the character's traits.
Parameters
traits
📋 table
The traits to set.
CHARACTER:SetUID(uid)
method
Set the character's unique ID.
Parameters
uid
📝 string
The unique ID to set.
CHARACTER:SetUsername(username)
method
Set the character's username (read-only).
Parameters
username
📝 string
The username (cannot be set after creation).
CHARACTER:SetWeight(weight)
method
Set the character's weight.
Parameters
weight
🔢 number
The weight to set.
CHARACTER:SetWetness(wetness)
method
Set the character's wetness level.
Parameters
wetness
🔢 number
The wetness level to set.
CHARACTER:Sync()
method
Updates stats, health, skills, traits, equipment, inventory, and position from the game state.
CHARACTER:TakeItem(uniqueID)
method
Take an item from a character's inventory.
Parameters
uniqueID
📝 string
The unique ID of the item to take.
Returns
✅ boolean
\string Whether or not the item was successfully taken and the success or failure message.
CHARACTER:TakeItemByInstanceID(instanceID)
method
Take an item from a character's inventory by its instance ID. Useful for taking a specific item from a stack.
Parameters
instanceID
🔢 integer
The instance ID of the item to take.
Returns
✅ boolean
\string Whether or not the item was successfully taken and the success or failure message.
CHARACTER:TakeItems(uniqueID, amount)
method
Take multiple items from a character's inventory by unique ID.
Parameters
uniqueID
📝 string
The unique ID of the items to take.
amount
🔢 integer
The number of items to take.