ScriptContext

顯示已棄用項目

*此內容很快就會推出您所選的語言版本。

無法建立
服務
未複製

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

概要

方法

  • SetTimeout(seconds : number):void
    外掛程式安全性

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

屬性

方法

SetTimeout

void
外掛程式安全性

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

參數

seconds: number

返回

void

活動

Error

Fired when an error occurs.

參數

message: string
stackTrace: string
script: Instance

範例程式碼

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