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/coroutinelibraries 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.