Globals
loadstring / load
function loadstring(chunk: string, chunkname: string?): function
function load(chunk: string, chunkname: string?): functionCompiles chunk into a callable function (load is equivalent for string chunks).
Two Matcha-specific differences: a syntax error still returns a function (the error only prints when the function is called — never
nil+ message, so it isn't catchable), and a chunk's top-levelreturnvalues are dropped (loadstring("return 5")()yields nothing — pass results out via globals).
decompile
function decompile(script: Instance): stringReturns the decompiled source of script (a LocalScript, ModuleScript, or Script) as a string. If decompilation fails, an error message is printed to the console.
WorldToScreen
function WorldToScreen(position: Vector3): (Vector2, boolean)Projects a 3D world position into 2D screen space. Returns the screen position in pixels (top-left origin) and a boolean that is true when the point is on screen; off screen or behind the camera returns (0, 0) and false.
local pos, onScreen = WorldToScreen(part.Position)
if onScreen then
-- pos.X, pos.Y are valid pixel coordinates
endnotify
function notify(message: string, title: string, duration: number)Shows a Matcha notification with the given message, title, and duration (seconds). Returns nothing.
identifyexecutor
function identifyexecutor(): (string, string)Returns two strings — the executor name ("Matcha") and its version (e.g. "1.0.0").
getrbxversion
function getrbxversion(): stringReturns the version string for the currently running Roblox client.
gethwid
function gethwid(): stringReturns the current device's hardware identifier as a string.
getscripthash
function getscripthash(script: Instance): stringReturns the FNV-1a 64-bit hash of script's bytecode, as a decimal string (e.g. "9950850631277792934").
getgamename
function getgamename(): stringReturns the name of the current place (e.g. "Baseplate"). This is the place title, distinct from game.Name.
getscripts
function getscripts(): { Instance }Returns an array of every loaded script instance (LocalScript, ModuleScript, Script) — a large list on a real place.
getscriptbytecode
function getscriptbytecode(script: Instance): stringReturns the raw compiled bytecode of script as a binary string.
base64encode
function base64encode(data: string): stringEncodes data to a standard Base64 string.
datais treated as null-terminated: encoding stops at the first\0byte (base64encode("a\0b")encodes only"a"). Base64 here is therefore not safe for arbitrary binary that may contain null bytes.
base64decode
function base64decode(data: string): stringDecodes a Base64 string back to the original bytes. base64decode("") returns "".
GetPingValue
function GetPingValue(): numberReturns the current ping value (latency to the server) in milliseconds.
tick
function tick(): numberReturns a high-precision time in seconds, advancing in real time. It's a monotonic clock, not a Unix timestamp like Roblox's tick — use it for measuring elapsed time.
typeof
function typeof(value: any): stringLike type, but returns the specific name for Roblox datatypes and objects (Vector3, CFrame, Instance, Drawing, …) instead of userdata.
getfenv
function getfenv(target: function | number): tableReturns an environment table. With no argument, 0, or 1, it returns the global environment (_G). Passing a function returns that function's environment (which differs from _G only if it was changed with setfenv).
setfenv
function setfenv(f: function, env: table): functionSets the environment of function f to env and returns f. Global lookups inside f are then resolved from env instead of _G.
local sandbox = { print = print }
setfenv(f, sandbox) -- f now only sees `sandbox` as its globals