Skip to main content

ClientSettings

This was deprecated in v1.0.0
No longer maintained; kept for existing projects. There is no direct replacement.
Deprecated

ClientSettings is no longer maintained and is kept only for existing projects. There is no direct replacement in this library.

A bare-bones key/value store for local (per-machine) settings. The module is a single shared table: read a setting by indexing it, write one by assigning to it, and every assignment fires the SettingChanged signal with the key and the new value. There are no Get / Set functions; plain indexing is the whole API. Values are kept in memory only, so they reset when the game restarts unless you save them yourself.

The source code calls the class LocalSettings and the Wally package is kashtheking/local-settings; both refer to this module.

local ClientSettings = require(path.to.ClientSettings)

ClientSettings.SettingChanged:Connect(function(key: string, value: any)
	print("Setting", key, "is now", value)
end)

ClientSettings.MusicVolume = 0.5 -- fires SettingChanged("MusicVolume", 0.5)
print(ClientSettings.MusicVolume) -- 0.5
ClientSettings.MusicVolume = nil -- removes it and fires SettingChanged("MusicVolume", nil)

Assigning fires the signal even when the value did not change. Do not assign to SettingChanged itself; it lives on the returned table, so writing to it replaces the signal instead of storing a setting. Depends on Sleitnick's Signal, which Wally installs alongside it.

Credits: the change event is Signal, by sleitnick (sleitnick's RbxUtil). Wally installs it.

Installation and guide: ClientSettings package page.

Types​

LocalSettings​

type LocalSettings = {}

The type of the backing settings table (empty at compile time, since settings are added at runtime). Exported for scripts that want to annotate the module.

Properties​

SettingChanged​

This item is read only and cannot be modified. Read Only
ClientSettings.SettingChanged: Signal<string,any>

Fires after any setting is assigned (ClientSettings.Key = value). Receives the key and the new value (nil when the setting was removed).

Show raw api
{
    "functions": [],
    "properties": [
        {
            "name": "SettingChanged",
            "desc": "Fires after any setting is assigned (`ClientSettings.Key = value`). Receives the key and the new value (`nil` when the setting was removed).",
            "lua_type": "Signal<string, any>",
            "readonly": true,
            "source": {
                "line": 64,
                "path": "packages/src/ClientSettings/init.luau"
            }
        }
    ],
    "types": [
        {
            "name": "LocalSettings",
            "desc": "The type of the backing settings table (empty at compile time, since settings are added at runtime). Exported for scripts that want to annotate the module.",
            "lua_type": "{}",
            "source": {
                "line": 52,
                "path": "packages/src/ClientSettings/init.luau"
            }
        }
    ],
    "name": "ClientSettings",
    "desc": ":::caution Deprecated\nClientSettings is no longer maintained and is kept only for existing projects. There is no\ndirect replacement in this library.\n:::\n\nA bare-bones key/value store for local (per-machine) settings. The module is a single shared\ntable: read a setting by indexing it, write one by assigning to it, and every assignment fires\nthe `SettingChanged` signal with the key and the new value. There are no `Get` / `Set`\nfunctions; plain indexing is the whole API. Values are kept in memory only, so they reset when\nthe game restarts unless you save them yourself.\n\nThe source code calls the class `LocalSettings` and the Wally package is\n`kashtheking/local-settings`; both refer to this module.\n\n```lua\nlocal ClientSettings = require(path.to.ClientSettings)\n\nClientSettings.SettingChanged:Connect(function(key: string, value: any)\n\tprint(\"Setting\", key, \"is now\", value)\nend)\n\nClientSettings.MusicVolume = 0.5 -- fires SettingChanged(\"MusicVolume\", 0.5)\nprint(ClientSettings.MusicVolume) -- 0.5\nClientSettings.MusicVolume = nil -- removes it and fires SettingChanged(\"MusicVolume\", nil)\n```\n\nAssigning fires the signal even when the value did not change. Do not assign to\n`SettingChanged` itself; it lives on the returned table, so writing to it replaces the signal\ninstead of storing a setting. Depends on Sleitnick's\n[Signal](https://sleitnick.github.io/RbxUtil/api/Signal/), which Wally installs alongside it.\n\n**Credits:** the change event is [Signal](https://sleitnick.github.io/RbxUtil/api/Signal/), by [sleitnick](https://github.com/Sleitnick) ([sleitnick's RbxUtil](https://sleitnick.github.io/RbxUtil/)). Wally installs it.\n\nInstallation and guide: [ClientSettings package page](/docs/packages/client-settings).",
    "deprecated": {
        "version": "v1.0.0",
        "desc": "No longer maintained; kept for existing projects. There is no direct replacement."
    },
    "source": {
        "line": 43,
        "path": "packages/src/ClientSettings/init.luau"
    }
}