ScriptContext
顯示已棄用項目
*此內容很快就會推出您所選的語言版本。
This service controls all BaseScript objects. Most of the properties and methods of this service are locked for internal use.
概要
方法
Limits how long a script is allowed to run without yielding.
活動
Fired when an error occurs.
屬性
方法
活動
Error
Fired when an error occurs.
參數
範例程式碼
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!")