Alright,
So I am making an Anti-Exploit Module and I want the User to be able to Set the settings through the loader script Eg...
require(03048303)
I have seen it on Admins before. I know it is possible. I just don't know how. And I couldn't find anything on the Roblox Wiki about it.
Thanks, Enomphia
(Response that helps will be upvoted :D)
You could make your module return a function (or a metatable with __call
to prevent using getfenv
on it), which accepts a table with settings as an argument.
Example:
local Settings = {} --module's code blabla return function(t) --verify if the table is valid or something Settings = t end
Or the one with __call
:
local Settings = {} --module's code blabla return setmetatable({}, {__call = function(self, t) --verify if the table is valid or something Settings = t end, __metatable = false})
And you would pass the settings like this:
require(03048303)({ Something = true })