Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Using Configurations Values with a Module Script?

Asked by 3 years ago
Edited 3 years ago

I’m attempting to use a configuration folder with my module script but what I have in the module script does not end up in the configuration value.

I have this script at the bottom of my configurations:

Settings.Configurations = {
     Test1 = “blah blah”,
     Test2 = true
}

Then the configurations folder under the module script with one string value and one book value, any help?

0
check errors User#30567 0 — 3y
0
1. you're using curly quotes User#30567 0 — 3y
0
2. iirc, the correct syntax is ["Test1"] = "blah blah" User#30567 0 — 3y
0
wrong TTChaos Gameplayer365247v2 1055 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

if that is everything in your module then youre missing a critical part, it should look like this

local Settings = {}
Settings.Configurations = {
    Test1 = "blah blah",
    Test2 = true
}

return Settings

then in the script youre requiring the module with, should look something like this

local settings = require(path to module)
local configs = settings.Configurations
--then you can access the content
local firstData = configs.Test1
print(firstData)
Ad

Answer this question