Defining Settings
Settings allow users to configure your script's behavior directly from the client UI. All settings must be created during script initialization.
Setting Types
BooleanSetting
A simple toggle (on/off).
const enabled = new BooleanSetting(script, "Enabled", "Whether the feature is active.", true);
// Reading the value
if (enabled.getValue()) {
// do something
}IntSetting
An integer value with a defined range.
const delay = new IntSetting(script, "Delay", "Ticks between actions.", 5, 0, 20);
// With a slider step
const speed = new IntSetting(script, "Speed", "Movement speed multiplier.", 10, 0, 100, 5);
var value = delay.getValue(); // numberDoubleSetting
A decimal value with a defined range.
ModeSetting
A dropdown that lets the user pick from a list of named modes.
RangeSetting
A dual-handle slider representing a min/max range.
Subgroups
Related settings can be organized under a SubGroup to keep the UI tidy.
Pass the
SubGroupinstance as the first argument instead ofscript.
Conditional Visibility
You can hide settings dynamically based on the state of other settings using .visible().
Last updated