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

How to gather settings in an admin system?

Asked by 5 years ago
Edited 5 years ago

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


0
Could you post the code of the Module in here too? joritochip 705 — 5y
0
Make sure the module's open sourced if you plan to release it to the public. TheeDeathCaster 2368 — 5y
0
I have not wrote anything in the Module yet, as thats the part i dont understand, however this is what i have. CharlieTinsley3 0 — 5y
0
Since your module will be returning a function, according to your script, `setup` could be the variable it takes as its parameter. TheeDeathCaster 2368 — 5y
View all comments (3 more)
0
oh ok CharlieTinsley3 0 — 5y
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. Chaddaking 60 — 5y
0
how would I go about doing that? like return(settings(script.Parent)) ? CharlieTinsley3 0 — 5y

Answer this question