Skip to content
Roblox API Reference

ScriptDebuggerService

Provides programmatic breakpoint management, execution control, and runtime inspection of Luau scripts during a playtest.
  • Not creatable
  • Not replicated
  • Service
Memory category
Instances
Own members
12
Inherited members
75
Subclasses
0
Siblings
608

Properties23

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Methods52

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byScriptDebuggerService10
  • ScriptDebuggerService:AddBreakpoint(scriptInstance: LuaSourceContainer,breakpoint: { [string]: any },): { [string]: any }
    Adds a breakpoint to a script. If a breakpoint already exists on the same script and line, its data is replaced.
    • Plugin security
    Parameters
    ParameterDescription
    scriptInstance: LuaSourceContainer
    The LuaSourceContainer to place the breakpoint on.
    breakpoint: { [string]: any }
    Dictionary describing the breakpoint configuration through the following key-value pairs:
    • Line — Required 1-based line number.
    • Enabled — Optional boolean whether the breakpoint is active. Default is true.
    • Condition — Optional string indicating the Luau expression which must be truthy to pause, for example "health < 10".
    • LogMessage — Optional string message logged when the breakpoint is hit. This string is parsed as a comma-separated list of Luau expressions, evaluated in the breakpoint's scope, and concatenated print()‑style with spaces between segments. String literals are quoted; bare identifiers reference live values. For example, "'count is', count" produces output like count is 7.
    • ContinueExecution — If true, the DataModel does not pause when the breakpoint is hit. Default is false.
    Returns
    TypeDescription
    { [string]: any }
    Dictionary indicating whether the breakpoint was placed successfully and on which line. Includes the following key-value pairs:
    • Verified — Boolean value indicating whether the breakpoint was placed successfully.
    • Line — The line number the breakpoint was placed on.
    • Message — Optional explanation if Verified is false.
  • ScriptDebuggerService:ClearBreakpoints()
    Removes all breakpoints across all scripts.
    • Plugin security
  • ScriptDebuggerService:Evaluate(expression: string,frameId: number? = nil,): { [string]: any }
    Evaluates a Luau expression in a stack frame's context.
    • Plugin security
    Parameters
    ParameterDescription
    expression: string
    The Luau expression to evaluate.
    frameId: number? = nil
    Optional frame identifier. If omitted, evaluates globally.
    Returns
    TypeDescription
    { [string]: any }
    Dictionary with the following key-value pairs:
    • Result — String representation of the evaluated result.
    • Type — String indicating the Luau type of the result ("number", "string", "table", "Instance", etc.).
    • VariablesReference — If greater than 0, drill into with GetVariables().
  • ScriptDebuggerService:GetRootVariables(frameId: number): { any }
    Returns the root variables (locals, upvalues, globals) for a stack frame.
    • Plugin security
    Parameters
    ParameterDescription
    frameId: number
    The frame identifier from a debug stack frame Id field (see GetStackTrace()).
    Returns
    TypeDescription
    { any }
    An array of script variable dictionaries, each containing the following key-value pairs:
    • Name — String value indicating the variable name or table key.
    • Value — String representation of the value.
    • Type — String indicating the Luau type ("number", "string", "table", "Instance", etc.).
    • Scope — ScriptVariableScope value (children inherit parent's scope).
    • VariablesReference — If greater than 0, call GetVariables() with this to get children.
  • ScriptDebuggerService:GetStackTrace(threadId: number,startFrame: number? = nil,): { [string]: any }
    Returns the call stack for a paused thread.
    • Plugin security
    Parameters
    ParameterDescription
    threadId: number
    The thread identifier from a script debug thread Id field (see GetThreads()).
    startFrame: number? = nil
    Optional 1-based frame index for paginated retrieval.
    Returns
    TypeDescription
    { [string]: any }
    Dictionary containing the frames ordered innermost (current) to outermost. Contains the following key-value pairs:
    • Frames — Array of debug stack frame dictionaries. Each dictionary item contains the following key-value pairs:
    • Id — Numerical frame identifier; use with GetRootVariables() and Evaluate().
    • Name — Human-readable name of the function at this frame.
    • ScriptPath — Full instance path of the script, for example "ServerScriptService.MainScript".
    • Line — 1-based line number where execution is paused at this frame.
    • TotalFrames — Total frame count, provided when paginating.
  • ScriptDebuggerService:GetThreads(): { any }
    Returns all paused Luau threads.
    • Plugin security
    Returns
    TypeDescription
    { any }
    An array of script debug thread dictionaries, each containing the following key-value pairs:
    • Id — Numerical thread identifier; use with GetStackTrace() and stepping.
    • Name — Human-readable name of the script.
  • ScriptDebuggerService:GetVariables(variablesReference: number): { any }
    Drills into structured variables (tables, Instances).
    • Plugin security
    Parameters
    ParameterDescription
    variablesReference: number
    A reference from a previous script variable's VariablesReference field (see GetRootVariables()).
    Returns
    TypeDescription
    { any }
    An array of script variable dictionaries representing the children in the same format as variable dictionaries from GetRootVariables(). Returns empty if the DataModel is not stopped at a breakpoint or exception, or when stopped via Pause().
  • ScriptDebuggerService:Pause()
    Requests the debugger to pause at the next safe point.
    • Plugin security
  • ScriptDebuggerService:RemoveBreakpoint(scriptInstance: LuaSourceContainer,line: number,): boolean
    Removes the breakpoint on the given script and line.
    • Plugin security
    Parameters
    ParameterDescription
    scriptInstance: LuaSourceContainer
    The LuaSourceContainer containing the breakpoint.
    line: number
    The 1-based line number of the breakpoint to remove.
    Returns
    TypeDescription
    boolean
    true if a breakpoint was removed, false if no breakpoint existed on the line.
  • ScriptDebuggerService:SetExceptionBreakMode(breakMode: Enum.DebugBreakModeType)
    Controls when the debugger pauses on exceptions.
    • Plugin security
    Parameters
    ParameterDescription
    breakMode: Enum.DebugBreakModeType
    The DebugBreakModeType to set.

Events11

Inherited fromObject1
Inherited fromInstance9
Defined byScriptDebuggerService1
  • ScriptDebuggerService.Resumed: RBXScriptSignal<(threadIds: { any })>
    Fires when a previously paused thread resumes execution.
    • Plugin security
    Parameters
    Parameter
    threadIds: { any }

Callbacks1

Defined byScriptDebuggerService1
  • ScriptDebuggerService.OnStopped: (stopped: { [string]: any }) -> { [string]: any }
    The primary callback for reacting to debugger pauses. Returns a resume action.
    • Plugin security
    Parameters
    ParameterDescription
    stopped: { [string]: any }
    Dictionary describing why the debugger paused. The following key-value pairs are valid:
    • Reason — ScriptStoppedReason why the debugger paused.
    • ThreadIds — Array of thread identifiers that stopped.
    • ExceptionText — Error message present when Reason is ScriptStoppedReason.Exception.
    Returns
    TypeDescription
    { [string]: any }
    Dictionary specifying how to resume execution. Contains the following key-value pairs:
    • steppedType — DebuggerResumeType describing how to resume.
    • threadId — Number indicating which thread to step. Required for step actions.