ScriptContext

Afficher les obsolètes
Création impossible
Service
Non répliqué

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

Résumé

Méthodes

  • SetTimeout(seconds : number):void
    Sécurité des plugins

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

Propriétés

Méthodes

SetTimeout

void
Sécurité des plugins

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

Paramètres

seconds: number

Retours

void

Évènements

Error

Fired when an error occurs.

Paramètres

message: string
stackTrace: string
script: Instance

Échantillons de code

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!")