Scripts

decompile

Attempts to decompile a script instance into readable Luau source.

Syntax

decompile(script: userdata): string

Arguments

NameTypeDescription
scriptuserdataScript or ModuleScript instance to inspect.

Returns

NameTypeDescription
sourcestringDecompiled source text.

Description

Attempts to decompile a script instance into readable Luau source.

Call it with 1 parameter(s): script. The argument table explains which values are required and which ones only refine the behavior.

It returns source (string). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = decompile(game)
print(result)