Closures

Environment functions

getgenv, getrenv, getreg, getgc, getconnections, firesignal, read-only tables, identity and Mappings.

Environment tables

getgenv()

Returns the script environment (the same table as _G).

getrenv()

Returns a frozen copy of the base globals (print, pairs, ...).

JVM access

getreg(options)

Returns registry information from the game's JVM. options and the result format are defined by the native layer.

getgc(options)

Returns objects from the game's JVM. options and the result format are defined by the native layer.

Signals

getconnections(signal)

Returns a copy of the list of connections on a signal. Raises an error if the argument is not a signal.

for _, c in ipairs(getconnections(RunService.Heartbeat)) do
  print(c.Connected, c.Function)
end

firesignal(signal, ...)

Fires a signal created with Signal.new or one of the built-in events.

Read-only tables

isreadonly(t)

Returns true if the table is frozen.

setreadonly(t, readonly)

setreadonly(t, true) freezes the table. A frozen table cannot be unfrozen: setreadonly(t, false) on a frozen table raises an error, so make a copy instead.

Identity

identifyexecutor()

Returns the name and version: "Agnes Tachyon", "1.0.0".

getexecutorname()

Returns "Agnes Tachyon".

isgameactive(), ismcactive()

Return whether the game window has focus.

cache

A table kept for compatibility.

FunctionBehaviour
cache.iscached(x)Always true
cache.invalidate(x)Does nothing
cache.replace(a, b)Does nothing

Mappings

Manages name-mapping data for a Minecraft version. The functions return whatever the native layer returns.

Mappings.update(version)

Updates the mappings for the given version string.

Mappings.status()

Returns the current mapping status.

Mappings.path(version)

Returns where the mappings for a version are stored.

Not available

checkcaller is not implemented in this version.