Skip to content
Roblox API Reference

ScriptContext

A service that manages the execution of all BaseScript objects.
  • Not creatable
  • Not replicated
  • Service
Memory category
Instances
Own members
11
Inherited members
75
Subclasses
0
Siblings
608

Properties24

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byScriptContext1

Property categoryState

  • ScriptContext.ScriptsDisabled: boolean = false
    • Hidden
    • Local user security

Methods50

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 byScriptContext8
  • ScriptContext:AddCoreScriptLocal(name: string, parent: Instance)
    • Roblox script security
    Parameters
    Parameter
    name: string
    parent: Instance
  • ScriptContext:CompressLuaApp()
    • Roblox script security
  • ScriptContext:EnableCoverage(instance: Instance)
    Marks an instance and its descendant scripts for code-coverage tracking. Requires PluginOrOpenCloud security.
    • Capabilities: PluginOrOpenCloud
    Parameters
    ParameterDescription
    instance: Instance
    The instance to track; coverage is recorded for this instance and every script descended from it.
  • ScriptContext:GetCoverageStats(): { any }
    Returns code-coverage statistics for scripts marked by EnableCoverage(). Requires PluginOrOpenCloud security.
    • Capabilities: PluginOrOpenCloud
    Returns
    TypeDescription
    { any }
    An array of per-script coverage tables, each with a Script field and a GetHits function for retrieving line and function hit counts.
  • ScriptContext:GetLuauHeapInstanceReferenceReport(target: string): { [string]: any }
    • Custom Lua state
    • Roblox script security
    Parameters
    Parameter
    target: string
  • ScriptContext:GetLuauHeapMemoryReport(target: string): { [string]: any }
    • Custom Lua state
    • Roblox script security
    Parameters
    Parameter
    target: string
  • ScriptContext:ReportLuaRequireCount()
    • Roblox script security
  • ScriptContext:SetTimeout(seconds: number)
    Limits how long a script is allowed to run without yielding.
    • Plugin security
    Parameters
    ParameterDescription
    seconds: number
    The maximum time, in seconds, that a script may run between yields before the watchdog interrupts it. A value of 0 disables the timeout.

Events12

Inherited fromObject1
Inherited fromInstance9
Defined byScriptContext2