Reference

Game Extension API

Methods added to the Roblox DataModel (game) by the Nodeal runtime.

Game Extension API

Nodeal extends the standard Roblox DataModel (the game global) with methods that drive its Dependency Injection and Environment Extension systems. These methods are available context-wide within the Nodeal runtime.


game:RegisterService

Registers a singleton object as a "Service." Once registered, this service becomes discoverable via game:GetService() by its registered name.

Signature

game:RegisterService(className: string, instance: table | Userdata): void

Parameters

NameTypeDescription
classNamestringThe unique identifier for the service.
instancetable | UserdataThe singleton object to register. Typically a Nodeal module.
Warning

Service Overriding: If you register a service with a name that matches a standard Roblox service (e.g., "Players"), Nodeal will prefer your custom implementation when game:GetService is called. Use this power with caution.

Example

local InventoryService = {}
function InventoryService:GetItems(player) return {} end
game:RegisterService("InventoryService", InventoryService)

game:GetService

The primary discovery method for Nodeal. It is a drop-in, virtualized replacement for the standard Roblox method.

Signature

game:GetService(className: string): any
Important

Unified Discovery: Nodeal's version of GetService checks the custom service registry first. If no custom service is found, it falls back to the native Roblox engine to fetch standard services like RunService or HttpService.

Example

local HttpService = game:GetService("HttpService") -- Native fallback
local Inventory = game:GetService("InventoryService") -- Custom Nodeal service

game:RegisterBuiltIn

Injects or overrides a global state across every module in your project. This is how Nodeal provides framework-wide utility libraries.

Signature

game:RegisterBuiltIn(builtInName: string, library: table | Userdata): void
Tip

Use RegisterBuiltIn to provide common utility libraries like Promise, Signal, or extended Math functions to every script without requiring an import call.

Example

local Logger = { log = print }
game:RegisterBuiltIn("Logger", Logger)
-- Now in any other module:
Logger.log("Built-in works!")

game:RegisterDecorator

Extends the framework by defining custom function decorators. This allows you to implement complex logic—like networking or access control—via simple annotations.

Signature

game:RegisterDecorator(tag: string, handler: function): void

Handler Specification

The handler is a wrapper function with the following signature: handler(self, func, ...metadataArgs) -> (actualFunc)

Example

game:RegisterDecorator("adminOnly", function(_, func, fallbackMessage)
return function(...)
if isAdmin(game.Players.LocalPlayer) then
return func(...)
else
warn(fallbackMessage or "Access Denied")
end
end
end)