getgenv
Returns the custom global environment of the executor.
function getgenv(): tabletableThe global environment table of the executor.Usage
Shared variable
getgenv().MySharedLib = {
greet = function(name)
return "Hello, " .. name
end
}
-- Accessible in any other script:
print(MySharedLib.greet("World")) -- "Hello, World"