userSettings.*
From SmartBots Developers Docs
Revision as of 13:21, 5 August 2025 by Gtaskincentral (Talk | contribs) (Add userSettings defaults example.)
Allows accessing the settings specified by the script user.
const value = userSettings.someUserVar;
User settings are intended to be used within the scripts you sell at Bots Store. However, they can be used for your own scripts, too.
Example: Setting defaults
An easy way to set defaults is to use the Object.assign() javascript function.
//Define the default settings here.
const defaultSettings = {
greetingMessage: "Hello, welcome!",
repeatCount: 2,
enableLogging: false
};
//Merge defaults with any values provided by the user.
const settings = Object.assign({}, defaultSettings, userSettings);
//Access the settings in the following way:
console.log(settings.greetingMessage);
Learn more
Check the User Settings reference for information how to define and set user settings.