Search code examples
mit-scratch

Is it possible to stop a function (custom block) while it is running in Scratch?


Can I stop code in a certain script from running when it is in another script? I know there is a stop block, but you can only stop the current script, all other scripts, or all scripts.


Solution

  • Here's a workaround: Create another hidden sprite with only the script you want to stop and the script you want to stop the first script. Then use a stop other scripts block on the empty sprite. You can use broadcast messages to signal the blank sprite when to stop the script.