Characters
The Characters module handles everything related to character customisation, including appearance styles, tattoos, clothing, and genetics. It is fully client-side and provides a consistent structure for defining, resetting, and applying player ped appearance.
Accessing the Module
local CHARACTERS <const> = exports.boii_utils:get("modules.characters")
Client
get_style(sex)
Retrieves the current appearance data structure for the given sex.
Parameters
sex
string
Either "m"
or "f"
to get the appropriate structure.
Example
local style = CHARACTERS.get_style("m")
print(style.clothing.jacket_style)
reset_styles()
Resets all style data back to defaults for both male and female presets.
Parameters
None
Example
CHARACTERS.reset_styles()
get_clothing_and_prop_values(sex)
Returns maximum drawable/texture values for clothing and props for UI sliders.
Parameters
sex
string
Either "m"
or "f"
Returns
A table of maximum drawable values.
Example
local values = CHARACTERS.get_clothing_and_prop_values("f")
print(values.hair, values.mask_texture)
set_ped_appearance(player, data)
Applies the full style data (genetics, hair, clothing, etc.) to the specified ped.
Parameters
player
number
The PlayerPedId()
to apply the style to.
data
table
The full character style data table.
Example
local ped = PlayerPedId()
local style = CHARACTERS.get_style("m")
CHARACTERS.set_ped_appearance(ped, style)
update_ped_data(sex, category, id, value)
Updates a specific field in the ped style table and applies the changes to the current ped.
Parameters
sex
string
"m" or "f" to choose the dataset
category
string
The sub-table: "genetics", "barber", or "clothing"
id
string
The field inside the category to update
value
number
or table
The value to assign
Example
CHARACTERS.update_ped_data("f", "barber", "hair", 6)
CHARACTERS.update_ped_data("f", "genetics", "eye_colour", 2)
change_player_ped(sex)
Changes the current player's ped model and reapplies stored appearance.
Parameters
sex
string
"m" or "f"
Example
CHARACTERS.change_player_ped("f")
rotate_ped(direction)
Rotates the current ped preview left, right, flip or reset.
Parameters
direction
string
"right", "left", "flip", or "reset"
Example
CHARACTERS.rotate_ped("left")
load_character_model(data)
Sets the current player's model and applies the entire style set from saved character data.
Parameters
data
table
The full identity and style structure used in character systems.
Example
CHARACTERS.load_character_model({
identity = { sex = "m" },
style = CHARACTERS.get_style("m")
})
Notes
All functions are client-only
Style tables are separated by sex (
m
,f
)Update functions apply changes immediately to ped
You can deep copy and modify style structures before applying them
Last updated