Hooks hooks
Part of Settings
Hooks called by Settings
Summary
Hooks
on_change function of the setting.ClientSettings:register_setting.Hooks
Called on the client when the value of a setting has changed, after the on_change
function of the setting. Do not return anything from the handler, or the plugins after
it are not told.
Parameters
- id String setting id
- value Any new value of the setting
- old_value Any previous value of the setting
Called from
value_changed
Call sites
Called on the server when a networked setting of a player has changed, and for
every networked setting that is not at its default value when the player joins.
The settings of a joining player arrive before PlayerInitialized runs for them, so
the player may not be initialized yet. Do not return anything from the handler, or
the plugins after it are not told.
Parameters
- actor Player The player whose setting has changed
- id String setting id
- value Any new value of the setting
- old_value Any previous value of the setting
Call sites
Lets plugins and the schema register their settings with
ClientSettings:register_setting. Called on the server and the client once all plugins
and the schema have been loaded, and again on every code refresh. Register a setting on
both realms if it is networked; a setting that is not can be registered on the client
only. A type added with ClientSettings:register_type has to be registered before the
settings that use it. Do not return anything from the handler, or the plugins after it
are not asked.