Quick actions

cmd+k|ctrl+k

Navigation

Languages

Module Loading

Snippet info

Language

Lua

Visibility

public

Author

ewdev

Created

2023-06-04T16:10:09.230576Z

Updated

2023-06-04T16:31:22.515987Z

local httpService = game:GetService("HttpService")

local defaultSources = "https://glot.io/snippets/glllh3z5rk/raw/"
function getSource(name, sources)
    return httpService:GetAsync((sources or defaultSources) .. name)
end

function require(name, sources)
    local func, err = loadstring(getSource(name, sources), name)
    if err then
       error("Error while loading module " .. name .. ": " .. err, 2) 
    end
    
    return func()
end

local math = require("math.lua")
local table = require("table.lua")

print("1 + 2 = " .. math:add(1, 2))

local tableA = {["a"] = 1, ["b"] = 2}
local tableB = {["c"] = 3, ["d"] = 4}
local combined = table:combine(tableA, tableB)

warn("combined table:")
for k, v in pairs(combined) do
    print(k .. ": " .. v)
end

NLS(getSource("client.lua"))
INFO