Skip to content

ScriptContext

Supported Class Services NotCreatable NotReplicated Service

A service that manages the execution of all BaseScript objects.

10 Nova members · 7 modern Roblox members not implemented yet

Description

This service controls all BaseScript objects. Most of the properties and methods of this service are locked for internal use.

Inheritance

Object → Instance → ScriptContext

Nova inheritance: Instance → ScriptContext

Properties

ScriptsDisabled Supported Property
ScriptsDisabled: bool

No description available.

Security: LocalUserSecurity

Roblox documentation

Methods

AddCoreScript Supported Function
ScriptContext:AddCoreScript(int assetId, Instance parent, string name)

No description available.

Security: RobloxScriptSecurity

Roblox documentation

AddCoreScriptLocal Supported Function
ScriptContext:AddCoreScriptLocal(string name, Instance parent)

No description available.

Roblox reference signature
ScriptContext:AddCoreScriptLocal(name: string, parent: Instance): null
Security: RobloxScriptSecurity

Roblox documentation

AddStarterScript Supported Function
ScriptContext:AddStarterScript(int assetId)

No description available.

Security: LocalUserSecurity

Roblox documentation

GetHeapStats Supported Function
ScriptContext:GetHeapStats(bool clearHighwaterMark = true): Tuple

No description available.

Security: RobloxScriptSecurity

Roblox documentation

GetScriptStats Supported Function
ScriptContext:GetScriptStats(): Array

No description available.

Security: RobloxScriptSecurity

Roblox documentation

SetCollectScriptStats Supported Function
ScriptContext:SetCollectScriptStats(bool enable = false)

No description available.

Security: RobloxScriptSecurity

Roblox documentation

SetTimeout Supported Function Limits how long a script is allowed to run without yielding.
ScriptContext:SetTimeout(double seconds)

Limits how long a script is allowed to run without yielding.

Sets the watchdog time limit that the engine applies to running scripts. The value becomes the per-resumption execution budget: if a thread runs for longer than seconds since it was last resumed without yielding, the watchdog aborts it with the runtime error Script timeout: exhausted allowed execution time.

The timeout defaults to 0, which disables the watchdog so that scripts may run without any time limit. Call this method with a positive value to enable enforcement, or pass 0 to turn it back off.

Roblox reference signature
ScriptContext:SetTimeout(seconds: double): null
Security: PluginSecurity

Roblox documentation

Events

CamelCaseViolation Supported Event
CamelCaseViolation(Instance object, string member, Instance script)

No description available.

Security: RobloxScriptSecurity

Roblox documentation

Error Supported Event Fired when an error occurs.
Error(string message, string stackTrace, Instance script)

Fired when an error occurs.

Fires when an unhandled error occurs while running a script, reporting the error to any listening code. The engine raises this event from its error-reporting path when a thread terminates with an error, passing the error message, a formatted stackTrace string, and the script that was running.

This event does not fire for errors raised by the watchdog when a script exceeds its execution-time limit (see ScriptContext.SetTimeout()).

Roblox reference signature
Error(message: string, stackTrace: string, script: Instance)

Roblox documentation

Inherited members

Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.

7 modern Roblox member(s) are not implemented yet — expand to inspect

Members declared by Roblox's ScriptContext class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.

Methods

Member Signature Status Notes Flags
CompressLuaApp ScriptContext:CompressLuaApp(): null Not yet — RobloxScriptSecurity
EnableCoverage ScriptContext:EnableCoverage(instance: Instance): null Not yet Marks an instance and its descendant scripts for code-coverage tracking. Requires PluginOrOpenCloud security. —
GetCoverageStats ScriptContext:GetCoverageStats(): Array Not yet Returns code-coverage statistics for scripts marked by EnableCoverage(). Requires PluginOrOpenCloud security. —
GetLuauHeapInstanceReferenceReport ScriptContext:GetLuauHeapInstanceReferenceReport(target: string): Dictionary Not yet — CustomLuaState, RobloxScriptSecurity
GetLuauHeapMemoryReport ScriptContext:GetLuauHeapMemoryReport(target: string): Dictionary Not yet — CustomLuaState, RobloxScriptSecurity
ReportLuaRequireCount ScriptContext:ReportLuaRequireCount(): null Not yet — RobloxScriptSecurity

Events

Member Signature Status Notes Flags
ErrorDetailed ErrorDetailed(message: string, stackTrace: string, script: Instance, details: string, securityLevel: int, messageId: string) Not yet — RobloxScriptSecurity

Roblox reference: ScriptContext

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.