Player class
Part of Settings
Player extension of the Settings plugin: reading the settings of a player on either realm.
Summary
Methods
get_setting(id, default)shared
Returns the value of a setting of the player.
Methods
Returns the value of a setting of the player.
On the server only networked settings are known, and only once the client of the player
has sent them, which happens shortly before PlayerInitialized runs for the player; until
then, for bots and for settings that are not networked the default of the setting is
returned. On the client the settings of the local player are read with
ClientSettings:get; those of other players are not known and are returned as their
defaults.
function MyPlugin:PlayerInitialized(actor)
if actor:get_setting('my_plugin_clock_format') == '12h' then
-- ...
end
end
Parameters
- id String setting id
- default Any optional, defaults to
nilreturned if the setting is not registered on this realm
Returns
- Any value of the setting