Docs menu · Settings+

    You are reading the docs of SDK 1.1.2, an older release. See the latest (1.11.0).

    Guides · SDK 1.1.2

    Settings

    Settings are options a player changes in the launcher's Mods tab, under your mod's row. You declare them in the manifest; the launcher draws the controls, keeps the values, and the game hands them to your mod at start. A change counts from the game's next start.

    Declaring them#

    JSON
    "settings": [
      { "key": "mode", "name": "Mode", "type": "choice", "default": "lock",
        "choices": [ { "value": "lock", "name": "Lock with weapons" },
                     { "value": "hold", "name": "Hold L2 or R2" } ],
        "description": "How the strafe starts." },
      { "key": "trace", "name": "Trace", "type": "bool", "default": false },
      { "key": "every", "name": "Log every", "type": "int", "default": 10, "min": 1, "max": 600 },
      { "key": "scale", "name": "Speed", "type": "float", "default": 1.0, "min": 0.5, "max": 3.0, "step": 0.1 },
      { "key": "greeting", "name": "Greeting", "type": "string", "default": "hi", "max_length": 40 }
    ]
    Field
    keylower case, digits and _: what your code asks for
    namethe label players see
    typebool, int, float, choice or string
    defaultthe value until the player changes it
    descriptionone line under the label (optional)
    min, maxint and float
    stepfloat
    choiceschoice: two or more {"value", "name"}
    max_lengthstring

    The launcher shows a switch for bool, a segmented control or a list for choice, and a field for the others.

    Reading them#

    Luauopenrac.setting("mode"): a boolean, number or string; nil for a key the manifest does not declare
    C++mod.setting<std::string>("mode"), setting<bool>, setting<int>, setting<double>, ...
    Capi->setting_string(mod, "mode"), setting_bool, setting_int, setting_float

    A value that is missing, of the wrong type or out of range is the default: your code always gets a valid value.

    Where the values are kept: where mods live (plugins.json).

    Generated from sdk/docs/settings.md at sdk-v1.1.2. Edit this page or report a problem.