ScriptContext

非推奨を表示

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

作成できません
サービス
複製されていません

このサービスはすべての BaseScript オブジェクトを制御します。このサービスのプロパティとメソッドの大部分は、内部使用のためロックされています。

概要

方法

  • SetTimeout(seconds : number):()
    プラグインのセキュリティ

    スクリプトが中断せずに実行できる期間を制限します。

イベント

プロパティ

方法

SetTimeout

()
プラグインのセキュリティ

スクリプトが中断せずに実行できる期間を制限します。

パラメータ

seconds: number
既定値: ""

戻り値

()

イベント

Error

エラーが発生したときに発射されます。

パラメータ

message: string
stackTrace: string
script: Instance

コードサンプル

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