Skip to main content

PlayerSettingsClient

This item only works when running on the client. Client

A player's current settings. Handles replication back to the server when a setting changes. See PlayerSettingsBase.

Functions

new

PlayerSettingsClient.new(
folderFolder,
serviceBagServiceBag
) → PlayerSettingsClient

See [SettingsBindersClient] and SettingsServiceClient on how to properly use this class.

GetValue

PlayerSettingsClient:GetValue(
settingNamestring,
defaultValueT
) → T

Gets a settings value

ObserveValue

PlayerSettingsClient:ObserveValue(
settingNamestring,
defaultValueT
) → Observable<T>

Observes a settings value.

SetValue

PlayerSettingsClient:SetValue(
settingNamestring,
valueT
) → ()

Sets a settings value and replicates the value eventually (in a de-duplicated manner).

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "See [SettingsBindersClient] and [SettingsServiceClient] on how to properly use this class.",
            "params": [
                {
                    "name": "folder",
                    "desc": "",
                    "lua_type": "Folder"
                },
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PlayerSettingsClient"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 39,
                "path": "src/settings/src/Client/Player/PlayerSettingsClient.lua"
            }
        },
        {
            "name": "GetValue",
            "desc": "Gets a settings value",
            "params": [
                {
                    "name": "settingName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "defaultValue",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 72,
                "path": "src/settings/src/Client/Player/PlayerSettingsClient.lua"
            }
        },
        {
            "name": "ObserveValue",
            "desc": "Observes a settings value.",
            "params": [
                {
                    "name": "settingName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "defaultValue",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 94,
                "path": "src/settings/src/Client/Player/PlayerSettingsClient.lua"
            }
        },
        {
            "name": "SetValue",
            "desc": "Sets a settings value and replicates the value eventually (in a de-duplicated manner).",
            "params": [
                {
                    "name": "settingName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 165,
                "path": "src/settings/src/Client/Player/PlayerSettingsClient.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerSettingsClient",
    "desc": "A player's current settings. Handles replication back to the server\nwhen a setting changes. See [PlayerSettingsBase].",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 8,
        "path": "src/settings/src/Client/Player/PlayerSettingsClient.lua"
    }
}