Eng:Broadcast () and Wait (block)

The Broadcast and Wait block is a Event block and a Stack block. The block sends a broadcast throughout the whole Scratch project any scripts that are halted with the When I Receive  block and are set to the broadcast will activate. This broadcast block lets scripts send broadcasts, and have them wait until all scripts activated by the broadcast end (unlike the Broadcast block, which will let its script continue without it waiting for the scripts activated by the broadcast). Broadcasts are a good way to have sprites and scripts communicate.

Example Uses
If a script must be activated without a user prompt and after the project has started, there is only one way broadcasts. Some common uses: When I receive [Sprite1 Talk v] say [Hi, Gobo!] for (2) secs broadcast [Sprite2 Talk v] and wait say [Let's talk about food.] for (2) secs
 * Talk show animations

glide (1) secs to x: (-148) y: (80) play sound [meow v] broadcast [move v] and wait
 * Ordinary animations

when gf clicked broadcast [decodeCloudData v] and wait ask [enter your password to resume your progress!] and wait set [i v] to [1] repeat until <(item (i) of [users v]) = (username)> change [i v] by (1) end decrypt password ::custom if <(answer) = (properPassword)> then broadcast [playGame v] else broadcast [cannotPlay v] end
 * Waiting for an online data decoding before starting

set [chat v] to [1] broadcast [P2 chat v] and wait
 * Mesh projects

Recursion
Broadcast blocks can also, in a way, induce recursion. Recursion happens when a block (or broadcast script in this article) calls on itself at some point in the code. It can be used to create fractals, create a forever loop, etc.