Roblox Guide Help

Settings Module

In your wally.toml file, add this to your dependencies:

[dependencies] settings-module = "release/settings-module@0.0.1"

You have two solutions to import this module, depending if you wish to import the Controller or the Service on your own, or if you let the module give you the right code.

local SettingsModule = require(ReplicatedStorage.Packages["settings-module"]) -- Serves for initialization for both the controller and -- the service depending where it's called.
local SettingsController = Knit.GetController("SettingsController")

Configuration

A file called SettingsModule.config.lua is to be created in ReplicatedStorage/Shared/Configs.

return table.freeze({ ["vfx"] = true, ["sound"] = true, ["trade"] = true, ["pets"] = true })

Explanation

This is simply a list of settings to be set to their default values by default.

Methods

Client Side

Explanation

  • setting: The name of the setting you're trying to fetch.


local petsVisible = SettingsController:IsSettingToggled("pets") petsModule:SetPetVisible(petsVisible)

    Client Side

    Explanation

    • setting: The name of the setting you're trying to set.

    • value: The value of the setting you're trying to set.


    SettingsController:SetSettingValue("vfx", false)
      Last modified: 06 December 2024