ScriptContext

Artık kullanılmayanları göster

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.

Oluşturulamaz
Hizmet
Çoğaltılmamış

Bu hizmet tüm BaseScript nesnelerini kontrol eder. Bu hizmetin özelliklerinin ve yöntemlerinin çoğu iç kullanım için kilitlenir.

Özellikler

Yöntemler

SetTimeout

()
Eklenti Güvenliği

Bir senaryonun verimli olmadan ne kadar süre çalışmasına izin verildiğini sınırlar.

Parametreler

seconds: number
Varsayılan değer: ""

Dönüşler

()

Etkinlikler

Error

Bir hata oluştuğunda ateş edilir.

Parametreler

message: string
stackTrace: string
script: Instance

Kod Örnekleri

When an error occurs, this example prints the name of the script that errored, the reason it errored, and a trace of the error.

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