Omega's Terminal documentation
Skip to main content

Wrapper/Core API

Functions

Init

wrapper.Init()

Starts the core, must be called first.


modifyConfig

wrapper:modifyConfig(newConfig: table, player: Player?)

Modifies the config of the terminal using a partial config table. A log will be generated with the player as the author if a player is provided.


AddAddon

wrapper:AddAddon(addonModule: AddonModuleScript)

Loads an addon module into the wrapper.


SwitchTerminalComponent

wrapper:SwitchTerminalComponent(name: string, newComponent: (any) -> any)

Switches a terminal component to a new one.


AddTickCallback

wrapper:AddTickCallback(f: (tickRate: number) -> nil, isAsync: boolean?, tickPhase: "preTick" | "postTick"?)

Adds a tick callback to be called every terminal tick. isAsync determines if the callback is called in an async thread. tickPhase determines if the callback is called before or after the terminal tick.


LoadTerminal

wrapper:LoadTerminal(terminalModule: TerminalModuleScript)

Loads a terminal module into the wrapper. Must be called before loading addons.


ToggleDebug

wrapper:ToggleDebug(enabled: boolean)

Toggles debug visuals for the terminal, not every terminal will show something.


updatePersistantConfig

wrapper:updatePersistantConfig()

Updates the persistant config instance located at ReplicatedStorage.OmegasTerminalConfig_Persistant with the core_configattribute and the propertiesattribute.


---

FreezeTime

wrapper.controls:FreezeTime(player: Player?)

Freezes the terminal time, logged as an action from the player if a player is provided.


UnfreezeTime

wrapper.controls:UnfreezeTime(player: Player?)

Unfreezes the terminal time, logged as an action from the player if a player is provided.


AddTime

wrapper.controls:AddTime(seconds: number, player: Player?)

Adds time to the terminal, logged as an action from the player if a player is provided.


AddProgress

wrapper.controls:AddProgress(team: "attackers" | "defenders", progress: number, player: Player?, ...)

Adds progress to a team, logged as an action from the player if a player is provided. Additional arguments are passed to the terminal's add progress function.


Lock

wrapper.controls:Lock(player: Player?)

Locks the terminal, logged as an action from the player if a player is provided.


Unlock

wrapper.controls:Unlock(player: Player?)

Unlocks the terminal, logged as an action from the player if a player is provided.


Reset

wrapper.controls:Reset(player: Player?)

Resets the terminal, logged as an action from the player if a player is provided.


Stop

wrapper.controls:Stop(player: Player?)

Stops the terminal, logged as an action from the player if a player is provided.


Start

wrapper.controls:Start(player: Player?, waitTime: number?)

Starts the terminal, logged as an action from the player if a player is provided. waitTime between sending the start event and actually unlocking the terminal.


Properties

defaultAddons

wrapper.defaultAddons

A shortcut to the default addons folder.


config

wrapper.config

The current config of the terminal.


terminal

wrapper.terminal

The current terminal module loaded in the wrapper.


terminalMetadata

wrapper.terminalMetadata

Metadata of the current terminal module loaded in the wrapper.


properties

wrapper.properties

A table used by addons to share data. It's content is replicated when updatePersistantConfig is called as it gets written as a JSON string in the properties attribute of the persistant config instance. Do not use for frequently changing data as it will cause unnecessary replication.


endTime

wrapper.endTime : number

The time at which the terminal will end relative to epoch time.


startTime

wrapper.startTime : number

The time at which the terminal started relative to epoch time.


started

wrapper.started : boolean

Whether the terminal has started or not.


persistantConfig

wrapper.persistantConfig : Instance

The persistant config instance located at ReplicatedStorage.OmegasTerminalConfig_Persistant.


logEvent

wrapper.logEvent : BindableEvent

The log event bindable event, fired whenever a log is generated with the message and a userId (or nil) as arguments.