Category
Modules
Read and change client modules and their settings from a script.
Modules lets a script read and change the modules in the ClickGUI. modules (lowercase) also exists, but it does not have Changed.
Module names and setting names are the ones shown in the ClickGUI. Setting values are numbers (toggles are 1 and 0).
Modules.list()
Returns an array of module names.
for _, name in ipairs(Modules.list()) do
print(name)
end
Modules.get(name)
Returns a table, or nil if the module does not exist.
| Field | Meaning |
|---|---|
Name | The module name |
Enabled | Whether it is on |
Settings | A table of setting name to number |
Modules.isEnabled(name)
Returns true if the module exists and is on.
Modules.setEnabled(name, on)
Turns a module on or off. Raises an error unknown module or setting: name/@enabled if the module does not exist.
Modules.toggle(name)
Flips a module.
Modules.getSetting(name, setting)
Returns the number stored in that setting, or nil.
Modules.setSetting(name, setting, value)
Sets a setting. Booleans become 1 or 0. Anything that is not a number counts as 0. Raises an error if the module or setting does not exist.
Modules.setEnabled("Auto Sprint", true)
Modules.setSetting("Module Name", "Setting Name", 4.2)
print(Modules.getSetting("Module Name", "Setting Name"))
Modules.Changed
A signal that fires (name, enabled) when a module is switched on or off, whether by a script or from the ClickGUI.
Modules.Changed:Connect(function(name, on)
print(name, on and "enabled" or "disabled")
end)
It checks about once per frame, and only while something is connected to it.