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

Help with settings module, returns nil?

Asked by 6 years ago
Edited 6 years ago

So, I have this script (module)

return{

['ClassTypes'] = {
    ['Economy'] = true;
    ['ECShirt']=false; -- leave false for free

    ['Business'] = true;
    ['BCShirt']=1087809366; -- replace with your Business' class shirt ID

    ['First'] = true;
    ['FCShirt']=1087809366; -- replace with your first class shirt ID
};
['Group'] = { -- connect checko to Discord (beta)
    ['GroupID'] = 3013520; -- Id OF YOUR GROUP
    ['MinGroupRank'] = 34; -- Minimun Rank To Check In People

};
['Admin'] = {
    ['Prefix'] = "!";  -- prefix of cmds
    ['Enabled'] = true; -- enabled?
    ['AdminRank'] = 0; -- Minimun Rank To Use The Admin Panel
};

['IFE'] = { -- Check In Flight Entertainment System
    ['Enabled'] = true;
};

}

But when I run :

print(require(game.Workspace.Checko.Configuration).ClassTypes.BCShirt)

nil

It returns nil

3 answers

Log in to vote
0
Answered by 6 years ago
print(require(--[[ ModuleScript location--]]).ClassTypes.BCShirt)

That works just fine to me, you might be calling it wrong or something

Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Try putting the module inside the script like this: click for image then inside the script :

local m = require(script.ModuleScript)
print(m.ClassTypes.BCShirt)

this printed 1087809366 You can also put the module script in any place else and just call it in the local m!
Hope this helped!

Log in to vote
0
Answered by
thesit123 509 Moderation Voter
6 years ago
Edited 6 years ago

I think the problem is with your module script. I am not an expert to Lua, but might be able to help. You're separating each meta-tables with ; and I think you should be using , instead:

return{

['ClassTypes'] = {
    ['Economy'] = true,
    ['ECShirt']=false, -- leave false for free

    ['Business'] = true,
    ['BCShirt']=1087809366, -- replace with your Business' class shirt ID

    ['First'] = true,
    ['FCShirt']=1087809366, -- replace with your first class shirt ID
},
['Group'] = { -- connect checko to Discord (beta)
    ['GroupID'] = 3013520, -- Id OF YOUR GROUP
    ['MinGroupRank'] = 34, -- Minimun Rank To Check In People

},
['Admin'] = {
    ['Prefix'] = "!",  -- prefix of cmds
    ['Enabled'] = true, -- enabled?
    ['AdminRank'] = 0, -- Minimun Rank To Use The Admin Panel
},

['IFE'] = { -- Check In Flight Entertainment System
    ['Enabled'] = true,
},

}

Answer this question