Skip to content
Engine

Reference

Engine API

Reference for the Engine object itself. GetService, GetSystem, GetPackage, GetBootInfo, how modules load and the errors they raise.

ServerClient

Getting it

Server
local Engine = require(game:GetService("ServerScriptService"):WaitForChild("Engine"))
Client
local Engine = require(game:GetService("ReplicatedStorage"):WaitForChild("Engine"))

Requiring Engine on the server boots it the first time and returns the same object every time after. The Loader script does that first require when the server starts.

Methods

GetService

Engine:GetService(name: string): any

Returns a service, ready to use. On the server it finds server and shared services; on the client, client and shared services. The first call for a name loads the service; every later call returns the same table.

local NetworkService = Engine:GetService("NetworkService")

GetSystem

Engine:GetSystem(name: string): any

Returns a system, ready to use. The first call for a name loads the system, which starts it.

GetPackage

Engine:GetPackage(name: string): any

Returns a package, ready to use. The first call for a name loads it. Packages are the same on both sides.

GetBootInfo

Engine:GetBootInfo(): BootInfo

Server only. How the running engine was started:

FieldDescription
Source"Live" (loaded from Roblox by an automatic shell), "Bundled" (the copy inside the shell) or "Direct" (required without a shell).
ShellVersionThe version of the shell that booted Engine, or 0 without a shell.

See Updates and Versions.

Loading

Engine loads a module the first time you get it and keeps it: every later call with the same name returns the same table. Modules you never get are never loaded.

With LogServiceLoads on in the General configuration, the first call for each module prints how long it took to load:

Engine: service "DataService" active (loaded in 3.12ms)

Note

In Engine 1.0.0 the getters returned a handle, and :Api() on that handle loaded the module. Since 1.1.0 they return the module itself. Remove :Api() from code written for 1.0.0, as shown in Updating from 1.0.0.

Errors

MessageCause
Engine: no service named "X" existsThe name is misspelled, or the module does not exist in this version. Names are case-sensitive.
Engine: "X" is a client service - require it from a LocalScript via ReplicatedStorage.EngineYou asked the server for a module that only exists on the client.
Engine: no client service named "X" exists (server-only services are not visible from the client)You asked the client for a server-only module, or misspelled the name.
Engine: the package "Config" is internal to Engine and not part of its APIConfig is used by Engine's modules to read configuration and cannot be used directly.
Engine: Configuration/X must return a tableA configuration module returned something other than a table.

The same messages exist for systems and packages.

Instances

InstanceDescription
ServerScriptService.EngineThe shell. Require it on the server.
ServerScriptService.Engine.LoaderBoots Engine when the server starts. Keep it enabled.
ServerScriptService.Engine.ConfigurationYour configuration.
ServerScriptService.Engine.MainModuleThe engine, for manual updates (with automatic updates it is loaded at runtime).
ReplicatedStorage.EngineThe client copy, created on every server start. Require it on the client; never edit it.

Types

export type Api = {
	GetService: (self: Api, name: string) -> any,
	GetSystem: (self: Api, name: string) -> any,
	GetPackage: (self: Api, name: string) -> any,
	GetBootInfo: (self: Api) -> BootInfo, -- server only
}
export type BootInfo = { ShellVersion: number, Source: BootSource }
export type BootSource = "Bundled" | "Live" | "Direct"