Hey, so I am trying to make a small little admin thingy, and wondering how I could gather all these settings into my MainModule script. I have made this basic example of settings, don't know if it is correct or not. I was thinking like a sort of "gatherSettings" function in the module script. Something like that, I do not know what I would put in the function however and how I could get the settings, maybe like return? I really do not know.

function gatherSettings()
	
end

The settings

-- loader

local setup = {
	
	admins = {"CharlieTinsley3", "Admin"};
	kickMessage = "You have been kicked from the game!";
	banMessage = "You have been banned from the game!";
}
																																																																										
require(2695624202)(setup)

The module, although it is empty.

local load = {}

function gatherSettings()
	
end

return load


7 comments

0

Could you post the code of the Module in here too?

0

Make sure the module's open sourced if you plan to release it to the public.

0

I have not wrote anything in the Module yet, as thats the part i dont understand, however this is what i have.

0

Since your module will be returning a function, according to your script, setup could be the variable it takes as its parameter.

0

oh ok

0

What I do is make a module inside the loader with all the settings, and whenever it's required it returns all the settings. So your main module can just require the settings module and get it easily.

0

how would I go about doing that? like return(settings(script.Parent)) ?