Plugins
Handles external plugin hook registration and execution. Used by internal systems and plugins to hook into the player object lifecycle and inject behaviours.
The plugins
module is only required for extending or modifying the player object during its lifecycle.
Internal systems and external plugins use it to inject custom behaviour during player initialization (e.g., adding extensions, methods, or syncing data).
register
Registers a plugin hook function to run during player initialization.
Parameters
name
(string): Unique name for the plugin.fn
(function): Function to execute.priority
(number|nil): Optional loading priority. Lower values run earlier.
run
Executes all registered plugin hooks for a given player object.
Parameters
player
(table): The player object to pass into each hook.
has_executed
Checks if a specific plugin hook has already run.
Parameters
name
(string): The plugin name to check.
Returns
boolean
: True if the plugin has been executed.
clear
Clears all registered hooks and their execution state.
Description
Resets the hook system, removing all previously registered hooks and clearing execution records.
Last updated