Player
has_loaded
Returns whether the player has completed loading.
Returns
boolean
: True if player has fully loaded.
dump_data
Logs all player data to the console using debug_log.
has_data
Check if the player contains a data category.
Parameters
category
(string
): The data category name.
Returns
boolean
: True if data exists.
get_data
Get a single category or all data.
Parameters
category
(string|nil
): Optional category to get.
Returns
table|nil
: The requested data or all player data.
add_data
Adds a data table to the player object.
Parameters
category
(string
): Category name.value
(table
): Data to store.replicated
(boolean|nil
): Whether to sync to client.
set_data
Merge changes into a category.
Parameters
category
(string
): Category name.updates
(table
): Table of changes.sync
(boolean|nil
): Sync to client.
Returns
boolean
: True on success.
remove_data
Removes and syncs a data category.
Parameters
category
(string
): Category to remove.
sync_data
Sync one or all replicated categories to client.
Parameters
category
(string|nil
): Category to sync, or all.
has_method
Check if a method exists.
Parameters
name
(string
): Method name.
Returns
boolean
: True if found.
get_method
Return a method reference.
Parameters
name
(string
): Method name.
Returns
function|nil
: Function if found.
add_method
Attach a method directly to a player instance.
Parameters
name
(string
): Method name.fn
(function
): Function reference.
remove_method
Remove a dynamic method.
Parameters
name
(string
): Method name.
has_extension
Check if the extension exists.
Parameters
name
(string
): Extension name.
Returns
boolean
: True if present.
get_extension
Get the extension table.
Parameters
name
(string
): Extension name.
Returns
table|nil
: The extension object.
add_extension
Attach an extension object.
Parameters
name
(string
): Extension key.obj
(table
): Object to attach.
list_extensions
Get a list of all extension keys.
Returns
string[]
: List of extension keys.
save
Triggers save_player()
on all extensions.
unload
Triggers unload_player()
on all extensions.
load
Attempts to load the main player from the database and calls load_player()
on extensions.
Returns
boolean
: True if successfully loaded.
Last updated