ScriptContext

Show Deprecated
Not Creatable
Service
Not Replicated

This service controls all BaseScript objects. Most of the properties and methods of this service are locked for internal use, however you may use the ScriptContext.ScriptsDisabled property to disable all scripts from a thread with normal security access.

Summary

Properties

Events

Error(message: string, stackTrace: string, script: Instance): RBXScriptSignal  

Fired when an error occurs.

ErrorDetailed(message: string, stackTrace: string, script: Instance, details: string, securityLevel: number): RBXScriptSignal  


Methods

AddCoreScriptLocal(name: string, parent: Instance): nil  


DeserializeScriptProfilerString(jsonString: string): Dictionary  CUSTOM LUA STATE


SetTimeout(seconds: number): nil  

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

StopScriptProfiling(): Dictionary  CUSTOM LUA STATE


Properties

Events

Error

Fired when an error occurs.

Parameters

message: string
stackTrace: string
script: Instance

Code Samples

ScriptContext.Error

1local ScriptContext = game:GetService("ScriptService")
2
3local function onError(message, trace, script)
4 print(script:GetFullName(), "errored!")
5 print("Reason:", message)
6 print("Trace:", trace)
7end
8
9ScriptContext.Error:Connect(onError)
10
11-- Somewhere, in another script
12
13error("Oh noes")

ErrorDetailed

Roblox Script Security

Parameters

message: string
stackTrace: string
script: Instance
details: string
securityLevel: number

Methods

AddCoreScriptLocal

Roblox Script Security

Parameters

name: string
parent: Instance

Returns

ClearScriptProfilingData

Roblox Script Security

Returns

DeserializeScriptProfilerString

Custom Lua State
Roblox Script Security

Parameters

jsonString: string

Returns

GetCoverageStats

Roblox Script Security

Returns

SaveScriptProfilingData

Roblox Script Security

Parameters

filename: string

Returns

SetTimeout

Plugin Security

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

Parameters

seconds: number

Returns

StartScriptProfiling

Roblox Script Security

Returns

StopScriptProfiling

Custom Lua State
Roblox Script Security

Returns