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 7 years ago
Edited 7 years ago

So, I have this script (module)

01return{
02 
03['ClassTypes'] = {
04    ['Economy'] = true;
05    ['ECShirt']=false; -- leave false for free
06 
07    ['Business'] = true;
08    ['BCShirt']=1087809366; -- replace with your Business' class shirt ID
09 
10    ['First'] = true;
11    ['FCShirt']=1087809366; -- replace with your first class shirt ID
12};
13['Group'] = { -- connect checko to Discord (beta)
14    ['GroupID'] = 3013520; -- Id OF YOUR GROUP
15    ['MinGroupRank'] = 34; -- Minimun Rank To Check In People
View all 28 lines...

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 7 years ago
1print(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 7 years ago
Edited 7 years ago

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

1local m = require(script.ModuleScript)
2print(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
7 years ago
Edited 7 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:

01return{
02 
03['ClassTypes'] = {
04    ['Economy'] = true,
05    ['ECShirt']=false, -- leave false for free
06 
07    ['Business'] = true,
08    ['BCShirt']=1087809366, -- replace with your Business' class shirt ID
09 
10    ['First'] = true,
11    ['FCShirt']=1087809366, -- replace with your first class shirt ID
12},
13['Group'] = { -- connect checko to Discord (beta)
14    ['GroupID'] = 3013520, -- Id OF YOUR GROUP
15    ['MinGroupRank'] = 34, -- Minimun Rank To Check In People
View all 28 lines...

Answer this question