Exernality Documentation

Complete Lua API reference for the Exernality executor

Introduction

Complete Lua API reference for the Exernality

Overview

Exernality is a upcoming Roblox executor with a focus on speed, stability, and security. It is designed to be a drop-in replacement for existing executors, with a familiar structure!

Installation

Download the latest release and unzip anywhere. Run Exernality.exe, then join a Roblox game and hit Inject. Scripts can be run from the Editor

Workspace

On first run a workspace folder is created at %LOCALAPPDATA%\Exernality. Scripts, logs, and files are stored here.

Your first script

Join a game, run as admin, hit Inject, then Ctrl+Enter in the Editor.

Example

Lua
local plr = game:GetService("Players").LocalPlayer print("hi from", plr.Name)

Environment

Environments, GC, and thread identity.

getgenv

Shared executor globals; values persist across script runs.

Lua
function getgenv(): table

getrenv

Roblox's own globals, the ones game scripts see.

Lua
function getrenv(): table

getsenv

Returns the environment table of the calling script. Alias: getmenv.

Lua
function getsenv(): table

getreg

Returns the Lua registry (index LUA_REGISTRYINDEX). Alias: getregistry.

Lua
function getreg(): table

getgc

Returns every collectable object currently tracked by the Luau GC. Pass true to include tables in the result.

Lua
function getgc(includeTables: boolean?): {any}

filtergc

Filters GC objects by type and attributes; returns one match or a list.

Lua
function filtergc(type: string, filter: table, first: boolean?): any

getidentity

Returns the current thread's Roblox identity (0-8). Aliases: getthreadidentity, getthreadcontext.

Lua
function getidentity(): number

setidentity

Sets the current thread's Roblox identity. Aliases: setthreadidentity, setthreadcontext.

Lua
function setidentity(level: number)

identifyexecutor

Executor name and version. Also: getexecutorname, getexecutorversion.

Lua
function identifyexecutor(): string, string

setclipboard

Places text onto the Windows clipboard. Aliases: toclipboard, setrbxclipboard.

Lua
function setclipboard(text: string)

setfpscap

Sets Roblox's target frame rate cap. Aliases: setfps, SetFps.

Lua
function setfpscap(fps: number)

getfpscap

Returns the current FPS cap. Aliases: getfps, GetFps.

Lua
function getfpscap(): number

queue_on_teleport

Runs a script after teleport. Alias: queueonteleport. Clear with clearqueueonteleport.

Lua
function queue_on_teleport(source: string)

require

Executor-side require that bypasses ModuleScript's normal require restrictions and works with asset IDs.

Lua
function require(module: ModuleScript | number): any

multiinstance

Drops this client's hold on Roblox's one-client-at-a-time lock, so the next Roblox you open starts instead of handing itself to this one. Returns true and how many handles it closed, or false and the reason. Aliases: multi_instance, closesingleton. The Multi instance setting does the same thing for every client Exernality attaches to; each client then listens on its own port from 6969 up, and the Clients panel picks the one your scripts run on.

Lua
function multiinstance(): boolean, number | string

Closures

Create, clone, check, and hook functions.

newcclosure

Wraps f with a C identity, needed by anti-tamper stack walks.

Lua
function newcclosure(f: function): function

newlclosure

New closure forwarding to f; guarantees an L-closure for debug APIs.

Lua
function newlclosure(f: function): function

iscclosure

True if f is a C closure. Alias: is_c_closure.

Lua
function iscclosure(f: function): boolean

islclosure

True if f is a Lua closure. Alias: is_l_closure.

Lua
function islclosure(f: function): boolean

isexecutorclosure

True if f was made by Exernality. Aliases: checkclosure, isourclosure.

Lua
function isexecutorclosure(f: function): boolean

isnewcclosure

True if f was produced by newcclosure.

Lua
function isnewcclosure(f: function): boolean

checkcaller

True when the caller is the executor, not a game script. Alias: check_caller.

Lua
function checkcaller(): boolean

clonefunction

Returns a deep copy of a function whose identity differs from f. Modifications to one do not affect the other.

Lua
function clonefunction(f: function): function

hookfunction

Redirects target through hook and returns the original. Alias: replaceclosure.

Lua
function hookfunction(target: function, hook: function): function

restorefunction

Undoes a previous hookfunction on the target. Alias: restorefunc.

Lua
function restorefunction(hooked: function)

isfunctionhooked

True if f has an active hook.

Lua
function isfunctionhooked(f: function): boolean

hookproto

Swaps a closure's compiled prototype. More invasive than hookfunction.

Lua
function hookproto(target: function, replacement: function)

restoreproto

Reverts a prior hookproto.

Lua
function restoreproto(target: function)

loadstring

Compiles Luau source into a callable function. Returns nil, errorMessage on syntax errors.

Lua
function loadstring(source: string, chunkname: string?): function?, string?

Metatables

Read, write, and lock metafields.

getrawmetatable

Returns the raw metatable of t, bypassing __metatable.

Lua
function getrawmetatable(t: any): table?

setrawmetatable

Sets the metatable of t, ignoring readonly protection.

Lua
function setrawmetatable(t: any, mt: table)

hookmetamethod

Hooks one metamethod (__index, __namecall, ...) and returns the original.

Lua
function hookmetamethod(t: any, event: string, hook: function): function

isreadonly

True if t is frozen.

Lua
function isreadonly(t: table): boolean

setreadonly

Locks or unlocks a table against writes. Also available as make_readonly / make_writeable.

Lua
function setreadonly(t: table, readonly: boolean)

getnamecallmethod

Inside a __namecall hook, returns the name of the method currently being called.

Lua
function getnamecallmethod(): string?

setnamecallmethod

Inside a __namecall hook, redirects the call to a different method name before invocation.

Lua
function setnamecallmethod(name: string)

isuntouched

True if the table is untouched since script start. Pair with setuntouched.

Lua
function isuntouched(value: any): boolean

Debug library

Inspect and mutate constants, upvalues, and stacks.

debug.getconstants

Returns the constants table baked into f's prototype.

Lua
function debug.getconstants(f: function): {any}

debug.getconstant

Returns a single constant by 1-based index.

Lua
function debug.getconstant(f: function, index: number): any

debug.setconstant

Replaces a constant in-place. Type of value must match the original.

Lua
function debug.setconstant(f: function, index: number, value: any)

debug.getupvalues

Returns the captured upvalues of f.

Lua
function debug.getupvalues(f: function): {any}

debug.setupvalue

Sets an upvalue by index.

Lua
function debug.setupvalue(f: function, index: number, value: any)

debug.getproto

Returns a nested prototype from f; all closures sharing it when active is true.

Lua
function debug.getproto(f: function, index: number, active: boolean?): function | {function}

debug.getprotos

Returns every child prototype declared inside f.

Lua
function debug.getprotos(f: function): {function}

debug.getstack

Returns the value at a stack slot in the given call frame. Omit index for the whole slice.

Lua
function debug.getstack(level: number, index: number?): any

debug.setstack

Writes a stack slot.

Lua
function debug.setstack(level: number, index: number, value: any)

debug.getinfo

Metadata for a function or stack frame: source, line, name, params, nups.

Lua
function debug.getinfo(levelOrFunc: number | function): table

debug.getregistry

Equivalent to top-level getreg.

Lua
function debug.getregistry(): table

debug.getmetatable

Bypasses __metatable shrouding. Companion setmetatable writes it back.

Lua
function debug.getmetatable(value: any): table?

Instances & Scripts

Caches, scripts, bytecode, and hidden properties.

getinstances

Returns every Instance in memory, including those unparented from the DataModel.

Lua
function getinstances(): {Instance}

getnilinstances

Returns only Instances whose Parent is currently nil.

Lua
function getnilinstances(): {Instance}

getscripts

Every LocalScript / ModuleScript currently loaded.

Lua
function getscripts(): {LuaSourceContainer}

getrunningscripts

Only scripts that are actively executing.

Lua
function getrunningscripts(): {LuaSourceContainer}

getloadedmodules

ModuleScripts whose result is cached by Roblox's require.

Lua
function getloadedmodules(): {ModuleScript}

getcallingscript

Returns the script associated with the current thread, or nil if there is no owning script.

Lua
function getcallingscript(): Instance?

getscriptbytecode

Returns the raw compiled bytecode of a script. Alias: dumpstring.

Lua
function getscriptbytecode(script: LuaSourceContainer): string

getscripthash

Returns a stable hash of a script's bytecode.

Lua
function getscripthash(script: LuaSourceContainer): string

getscriptclosure

Compiles source and returns the main closure without running it. Alias: getscriptfunction.

Lua
function getscriptclosure(script: LuaSourceContainer): function

decompile

Returns pseudocode for the compiled bytecode of a script.

Lua
function decompile(script: LuaSourceContainer): string

gethiddenproperty

Reads a non-scriptable property. Second return value indicates whether the property was hidden.

Lua
function gethiddenproperty(inst: Instance, property: string): any, boolean

sethiddenproperty

Writes a non-scriptable property. Returns whether the property was hidden.

Lua
function sethiddenproperty(inst: Instance, property: string, value: any): boolean

isscriptable

True if a property is currently marked scriptable.

Lua
function isscriptable(inst: Instance, property: string): boolean

setscriptable

Toggles scriptable-ness of a property. Returns the previous state.

Lua
function setscriptable(inst: Instance, property: string, scriptable: boolean): boolean

cloneref

Returns a distinct reference to the same underlying Instance, used to defeat identity comparisons.

Lua
function cloneref(inst: Instance): Instance

compareinstances

True if two references (including cloned ones) point to the same underlying Instance.

Lua
function compareinstances(a: Instance, b: Instance): boolean

gethui

Returns a hidden UI container that game scripts cannot see. Parent your UIs here to protect them from cleanup.

Lua
function gethui(): Instance

Signals

Connect, inspect, and replicate signals.

getconnections

Each returned Connection exposes Enable, Disable, Fire, and the underlying Function.

Lua
function getconnections(signal: RBXScriptSignal): {Connection}

firesignal

Invokes every listener attached to signal with the supplied arguments.

Lua
function firesignal(signal: RBXScriptSignal, ...)

firetouchinterest

Simulates a Touch/TouchEnded event between two parts. state = 0 fires Touched, state = 1 fires TouchEnded.

Lua
function firetouchinterest(a: BasePart, b: BasePart, state: number)

fireclickdetector

Fires the MouseClick event of a ClickDetector.

Lua
function fireclickdetector(cd: ClickDetector, distance: number?)

fireproximityprompt

Triggers a proximity prompt as if the player had held the interaction key.

Lua
function fireproximityprompt(pp: ProximityPrompt)

getsignalarguments

Argument names and types of a signal. Companion: getsignalargumentsinfo.

Lua
function getsignalarguments(signal: RBXScriptSignal): {any}

getsignalwhitelist

Returns the list of remote signals allowed to be replicated to server.

Lua
function getsignalwhitelist(): {string}

getrendersteppedlist

Returns every function currently registered on RunService.RenderStepped.

Lua
function getrendersteppedlist(): {function}

cansignalreplicate

True if firesignal against this signal will replicate to the server.

Lua
function cansignalreplicate(signal: RBXScriptSignal): boolean

replicatesignal

Fires signal and forces the invocation to replicate.

Lua
function replicatesignal(signal: RBXScriptSignal, ...)

Filesystem

Sandboxed file and folder access.

readfile

Returns the contents of a file as a string.

Lua
function readfile(path: string): string

writefile

Overwrites path with data. Creates parent directories as needed.

Lua
function writefile(path: string, data: string)

appendfile

Appends data to the end of a file.

Lua
function appendfile(path: string, data: string)

listfiles

Returns the names of the entries in a folder.

Lua
function listfiles(path: string): {string}

isfile

True if path refers to an existing file.

Lua
function isfile(path: string): boolean

isfolder

True if path refers to an existing folder.

Lua
function isfolder(path: string): boolean

makefolder

Creates a folder (and any missing parents).

Lua
function makefolder(path: string)

delfile

Deletes a file.

Lua
function delfile(path: string)

delfolder

Recursively deletes a folder and everything inside.

Lua
function delfolder(path: string)

loadfile

Compiles a file into a callable function without running it. Returns nil, err on syntax errors.

Lua
function loadfile(path: string): function?, string?

dofile

Reads and executes a file in-place.

Lua
function dofile(path: string)

getcustomasset

rbxasset:// URI for a workspace file, usable in image/sound/mesh properties.

Lua
function getcustomasset(path: string): string

Networking

HTTP requests and WebSocket connections.

request

HTTP client. Options: Url, Method, Body, Headers. Returns Success, StatusCode, Headers, Body. Alias: http_request.

Lua
function request(options: table): table

HttpGet

Simple GET that returns the response body. Also bound as the global game:HttpGet. Aliases: httpget, http_get.

Lua
function httpget(url: string): string

getobjects

Loads Roblox assets from an asset ID URL. Bound as game:GetObjects. Aliases: getobjects, get_objects.

Lua
function getobjects(assetId: string): {Instance}

WebSocket.connect

Opens a WebSocket with Send, Close, OnMessage, and OnClose.

Lua
function WebSocket.connect(url: string): WebSocketClient

Input

Keyboard and mouse input synthesis.

isrbxactive

True when the Roblox window has focus. Aliases: isgameactive, iswindowactive.

Lua
function isrbxactive(): boolean

mouse1click

Simulates a left mouse-button click.

Lua
function mouse1click()

mouse1press

Presses (but does not release) the left mouse button.

Lua
function mouse1press()

mouse1release

Releases the left mouse button.

Lua
function mouse1release()

mousemoveabs

Moves the cursor to absolute screen coordinates.

Lua
function mousemoveabs(x: number, y: number)

mousemoverel

Moves the cursor by a delta.

Lua
function mousemoverel(dx: number, dy: number)

mousescroll

Scrolls the wheel by delta ticks.

Lua
function mousescroll(delta: number)

keypress

Presses a virtual-key code. Alias: keyclick.

Lua
function keypress(keyCode: number)

keyrelease

Releases a virtual-key code.

Lua
function keyrelease(keyCode: number)

keytap

Press-and-release convenience.

Lua
function keytap(keyCode: number)

messagebox

Shows a native Windows message box; returns the button ID pressed.

Lua
function messagebox(text: string, caption: string, flags: number?): number

Cryptography

Encryption, hashing, and encoding helpers.

crypt.encrypt

Encrypts with AES or Blowfish modes. Returns base64 ciphertext and IV.

Lua
function crypt.encrypt(data: string, key: string, iv: string?, mode: string?): string, string

crypt.decrypt

Reverses crypt.encrypt.

Lua
function crypt.decrypt(data: string, key: string, iv: string, mode: string?): string

crypt.hash

Hashes with MD5, SHA1, SHA224, SHA256, SHA384, SHA512, or the SHA3_* variants.

Lua
function crypt.hash(data: string, algorithm: string): string

crypt.hmac

Returns an HMAC digest using the given hash algorithm.

Lua
function crypt.hmac(data: string, key: string, algorithm: string): string

crypt.generatebytes

Returns count cryptographically-secure random bytes, base64-encoded.

Lua
function crypt.generatebytes(count: number): string

crypt.generatekey

Returns a 32-byte random key, base64-encoded, suitable for AES-256.

Lua
function crypt.generatekey(): string

crypt.random

Cryptographically-secure integer in [min, max].

Lua
function crypt.random(min: number, max: number): number

crypt.base64encode / decode

Base64 encode/decode, also exposed as base64encode and base64decode globals.

Lua
function crypt.base64encode(data: string): string

lz4compress / lz4decompress

LZ4 round-trip. Available at the top level and as crypt.lz4compress / crypt.lz4decompress.

Lua
function lz4compress(data: string): string

Cache

Roblox instance cache and comparisons.

cache.invalidate

Drops an Instance's cache handle; later lookups return a fresh userdata.

Lua
function cache.invalidate(inst: Instance)

cache.iscached

True if the Instance is currently cached.

Lua
function cache.iscached(inst: Instance): boolean

cache.replace

Replaces one cache entry with another. Every Lua reference to inst now resolves to replacement.

Lua
function cache.replace(inst: Instance, replacement: Instance)

Console

Dedicated Windows console output.

rconsolecreate

Allocates a Windows console window for print output.

Lua
function rconsolecreate()

rconsoleprint

Writes text to the rconsole. No newline is appended.

Lua
function rconsoleprint(text: string)

rconsolesettitle

Sets the console window's title.

Lua
function rconsolesettitle(title: string)

Drawing

ImGui-style overlay primitives.

Drawing.new

Creates a drawing object: Line, Text, Image, Circle, Square, Quad, or Triangle.

Lua
function Drawing.new(type: string): DrawingObject

cleardrawcache

Destroys every existing drawing object.

Lua
function cleardrawcache()

isrenderobj

True if value is a Drawing object.

Lua
function isrenderobj(value: any): boolean

getrenderproperty

Reads a property by name. Equivalent to indexing the object directly.

Lua
function getrenderproperty(obj: DrawingObject, property: string): any

setrenderproperty

Writes a property.

Lua
function setrenderproperty(obj: DrawingObject, property: string, value: any)

Actors

Messaging between parallel-Lua actors.

run_on_actor

Compiles source and executes it inside the actor's isolated VM.

Lua
function run_on_actor(actor: Actor, source: string, ...)

isparallel

True if the current thread is running in an actor's parallel VM.

Lua
function isparallel(): boolean

Back to home