Disabling/Destroying a script fails to terminate its thread

Despite what the documentation claims (“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.”), disabling or destroying a script from within its own thread fails to terminate the thread.

  • However, all active derived threads created through the task/coroutine libraries are successfully terminated upon script disabling/destruction
  • The only scenario where a script’s main thread gets terminated upon disabling/destruction is if the main thread is currently yielding and is disabled/destroyed by an external thread (not derived from the main thread)


Repro:
Repro.rbxl (68.0 KB)

Expected behavior

The script thread should be terminated immediately upon destruction/disabling to maintain documentation accuracy and behavioral consistency.

Thank you for the report.

This is an issue with the documentation, not the implementation.

Thanks Arctic, I corrected the documentation here.