Trying to load modules based on a value in a variable. Is this possible?
local moduletoload = "login"
local mod_action = require moduletoload
Thanks
Trying to load modules based on a value in a variable. Is this possible?
local moduletoload = "login"
local mod_action = require moduletoload
Thanks
Share Improve this question asked Jan 20 at 3:56 DanDan 2,4895 gold badges31 silver badges50 bronze badges1 Answer
Reset to default 2When the argument is a string or table, you can omit parentheses, which is specified by Lua, but in other cases parentheses must be used.
local mod_action = require(moduletoload)