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
Sets whether BaseScript objects run their code. Scripts that are already running won't stop running.
HIDDEN
Properties inherited from Instance
Methods
Methods inherited from Instance
Events
Fired when an error occurs.
ErrorDetailed(message: string, stackTrace: string, script: Instance, details: string, securityLevel: number): RBXScriptSignal
Events inherited from Instance
Properties
ScriptsDisabled
Sets whether BaseScript objects run their code. Scripts that are already running won't stop running.
Properties inherited from Instance
Methods
ClearScriptProfilingData
void
Roblox Script Security
Returns
void
SetTimeout
void
Plugin Security
Limits how long a script is allowed to run without yielding.
Returns
void
StartScriptProfiling
void
Roblox Script Security
Returns
void
Methods inherited from Instance
Events
Error
Code Samples
ScriptContext.Error
local ScriptContext = game:GetService("ScriptContext")
local function onError(message, trace, script)
print(script:GetFullName(), "errored!")
print("Reason:", message)
print("Trace:", trace)
end
ScriptContext.Error:Connect(onError)
-- Somewhere, in another script
error("Error occurred!")
Events inherited from Instance