TerminateThread
This function was added in DSL 1
Description
Terminate a thread or the current thread.
This function replaces the existing TerminateThread. If DSL is not running or UseBaseGameScriptFunctions was called with true, the original function is used. Otherwise it will shutdown thread or the current thread.
function TerminateThread(thread) --[[ ... ]] end
Parameters
thread?:thread|nil- (Optional) The thread to terminate. If not provided, the current thread is terminated.
Return Values
None.
Example
Create a thread that will terminate itself after 1 second
local thread = CreateThread(function()
Wait(1000)
TerminateThread() -- Terminate the current thread
end)