GetScriptEnvironment
This function was added in DSL 1
Description
Returns the environment assigned to script or the current script.
function GetScriptEnvironment(script) --[[ ... ]] end
Parameters
script?:userdata|script|nil- (Optional) The script object.userdataif checked withtype(script),scriptif checked withtype2(script).
Return Values
environment:table- The environment assigned to the script.
Example
local someLocal = 7
someGlobal = 7
for key, value in pairs(GetScriptEnvironment()) do
print(key, value)
end
--[[ Output:
exports table: XXXXXXXX
ImportScript: function: XXXXXXXX
someGlobal 7
]]