BaseScript

แสดงที่เลิกใช้งานแล้ว

*เนื้อหานี้จะพร้อมใช้งานในภาษาที่คุณเลือกในเร็วๆ นี้

ไม่สามารถสร้าง

The base class for all script objects which run automatically.

สรุป

คุณสมบัติ

  • อ่านพร้อมๆ กัน

    Determines whether a BaseScript will run or not.

  • ไม่ซ้ำ
    อ่านพร้อมๆ กัน

    Determines whether a BaseScript will run or not.

  • อ่านพร้อมๆ กัน

    Determines the context under which the script will run.

คุณสมบัติ

Disabled

อ่านพร้อมๆ กัน

Determines whether a BaseScript will run or not.

If a script is disabled by changing this property to true while the script is running, the current running thread of the script will be terminated.

If this property is changed from true to false, the script will run again. This means that Disabled can be toggled to restart a script:


scriptObject.Disabled = true
scriptObject.Disabled = false

Note that the above code snippet cannot be used within the script itself, since disabling the script from within itself will terminate the thread and the line to reenable it will never execute.

Enabled

ไม่ซ้ำ
อ่านพร้อมๆ กัน

Determines whether a BaseScript will run or not. This should be used in favor of the similar but opposite Disabled property.

If a script is disabled by changing this property to false while the script is running, the current running thread of the script will be terminated.

If this property is changed from false to true, the script will run again. This means that Enabled can be toggled to restart a script:


scriptObject.Enabled = false
scriptObject.Enabled = true

Note that the above code snippet cannot be used within the script itself, since disabling the script from within itself will terminate the thread and the line to reenable it will never execute.

RunContext

อ่านพร้อมๆ กัน
การรักษาความปลอดภัยของปลั๊กอิน

Determines the context under which the script will run.

When using the Legacy RunContext scripts will only run when parented to certain containers dependent on whether they are a Script or LocalScript.

If RunContext is assigned while the script is running any threads created by the script will be terminated and the script will start running under the new context if possible.

Note, RunContext cannot be used from a LocalScript.

วิธีการ

อีเวนต์