Script:stop_all_threads

Stops all threads in this script. See Thread:stop for more details on what it means to stop a thread.

Usage

script:stop_all_threads()

Examples

local script = Script:new();

script:run_thread(function(self)
  while true do
    self:wait_frame();
    print("Hello");
  end
end);

script:run_thread(function(self)
  while true do
    self:wait_frame();
    print("Bonjour");
  end
end);

script:update(0); -- Prints "Hello" and "Bonjour" (in any order)
script:update(0); -- Prints "Hello" and "Bonjour" (in any order)
script:stop_all_threads();
script:update(0); -- Does nothing

This site uses Just the Docs, a documentation theme for Jekyll.