ScriptContext
非推奨を表示
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
このサービスはすべての BaseScript オブジェクトを制御します。このサービスのプロパティとメソッドの大部分は、内部使用のためロックされています。
概要
方法
スクリプトが中断せずに実行できる期間を制限します。
イベント
エラーが発生したときに発射されます。
プロパティ
方法
イベント
Error
エラーが発生したときに発射されます。
パラメータ
コードサンプル
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!")