Globals¶
Scripts executed by Rostruct have modified globals to stay consistent with how actual Roblox scripts run.
For example, in Rostruct scripts, the require()
function is modified to load the ModuleScript objects Rostruct creates, and provides a detailed error traceback for recursive require()
calls.
Global environments are modified internally with the setfenv()
function. Rostruct also adds some extra globals for convenience:
_ROOT
¶
const _ROOT: string
A reference to the Package's root
property.
_PATH
¶
const _PATH: string
A path to the Lua file that is being executed.