ScriptContext

Mostrar obsoleto
Não criável
Serviço
Não replicado

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

Resumo

Métodos

  • SetTimeout(seconds : number):void
    Segurança do plugin

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

Eventos

Propriedades

Métodos

SetTimeout

void
Segurança do plugin

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

Parâmetros

seconds: number

Devolução

void

Eventos

Error

Fired when an error occurs.

Parâmetros

message: string
stackTrace: string
script: Instance

Amostras de código

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