FrameworkZ API Documentation - CHARACTER

CHARACTER

class

Character class for FrameworkZ.

0
Functions
65
Methods
1
Fields

📋 On This Page

Fields

1
CHARACTER 📋 table
Character class for FrameworkZ.
Initial value: {}

Methods

65

CHARACTER: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: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:GetDescription()

method
Get the character's description.

Returns

📝 string
The character's description.

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: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:GetHeight()

method
Get the character's height.

Returns

🔢 number
The character's height.

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: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:GetLogicalInventory()

method
Get the character's logical inventory data.

Returns

📋 table
The character's logical inventory data.

CHARACTER:GetName()

method
Get the character's name.

Returns

📝 string
The character's name.

CHARACTER:GetPhysicalInventory()

method
Get the character's physical inventory data.

Returns

📋 table
The character's physical inventory data.

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: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:GetSkinColor()

method
Get the character's skin color.

Returns

🔢 integer
The character's skin color constant.

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: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()

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: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:Save()

method
Save the character's data from the character object.

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:SetDescription(description)

method
Set the character's description.

Parameters

description 📝 string
The description 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: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:SetHeight(height)

method
Set the character's height.

Parameters

height 🔢 number
The height 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:SetLogicalInventory(logicalInventory)

method
Set the character's logical inventory data.

Parameters

logicalInventory 📋 table
The logical inventory data to set.

CHARACTER:SetName(name)

method
Set the character's name.

Parameters

name 📝 string
The name to set.

CHARACTER:SetPhysicalInventory(physicalInventory)

method
Set the character's physical inventory data.

Parameters

physicalInventory 📋 table
The physical inventory data 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:SetSkinColor(skinColor)

method
Set the character's skin color.

Parameters

skinColor 🔢 integer
The skin color constant 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: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.