Global Functions
All global functions injected or extended by the Nodeal runtime.
Global Functions
The Nodeal virtualization layer injects a suite of global functions that provide intelligent dependency resolution, enhanced type checking, and advanced proxy manipulation.
The cornerstone of Nodeal. It resolves modules by their registered name, abstracting away the physical file hierarchy of your project.
import(moduleName: string): any| Name | Type | Description |
|---|---|---|
moduleName | string | The unique name of the module assigned in the Nodeal Dashboard. |
Path Independence: Because import uses a lookup table built by the Pre-Parser, you can move a module from ServerStorage to ReplicatedStorage without changing a single line of code in the scripts that import it.
local InventoryService = import("InventoryService")local PlayerData = InventoryService:Get(game.Players.LocalPlayer)While Luau provides a basic newproxy, Nodeal's version is significantly enhanced. It allows for the "wrapping" of existing objects (including Roblox Instances) to create secure, metatable-driven proxies.
newproxy(target: boolean | any): Userdata| Name | Type | Description |
|---|---|---|
target | boolean | any | If true, creates a new empty proxy. If an object is passed, creates a proxy that wraps that specific object. |
Instance Wrapping: Using newproxy(Instance) allows you to create a "Virtual Instance" that can intercept property access and method calls before they hit the real engine object.
-- Creating a secure wrapper for the Players servicelocal RealPlayers = game:GetService("Players")local ProxyPlayers = newproxy(RealPlayers)getmetatable(ProxyPlayers).__index = function(self, key) print("Intercepted access to Players." .. key) return RealPlayers[key]endStandard typeof is often insufficient for custom classes. Nodeal's version respects the __type metamethod, allowing your custom objects to participate in the native type system.
typeof(value: any): stringstring: The value ofmetatable.__typeif it exists; otherwise, the standard Luau type.
local MyClass = {}local instance = newproxy(true)getmetatable(instance).__type = "MySpecialClass"print(typeof(instance)) -- "MySpecialClass"Enhanced to support unpacking Nodeal proxies and any object that implements the __unpack metamethod.
unpack(target: table | Userdata, start: number?, finish: number?): ...anyThis is particularly useful when working with custom Collection types or Proxy Wrappers where the underlying data structure isn't a standard table.
local proxy = newproxy(true)getmetatable(proxy).__unpack = function() return "Nodeal", 2024, trueendlocal a, b, c = unpack(proxy)print(a) -- Nodeal