#require specific things from module

3 messages · Page 1 of 1 (latest)

smoky jasper
#

Module

local ModuleTable = {"Hi", 43, 1 + 2}
return ModuleTable

Script

local Module = require(YOUR_MODULE)
print(Module)

Output:
Hi 43 3

smoky jasper
#

Search online then, I can't explain that now

pulsar token
#
local function thingThatSearchThings(module, ...)
    local t = {}
    local Module = require(module)
    for i, v in ipairs({...}) do
        table.insert(t, Module[v])
    end
    return table.unpack(t)
end
local This1, this2 = thingThatSearchThings(module, "This1", "This2")