when stop sign clicked

From PenguinMod Wiki (Official)
Revision as of 15:48, 25 August 2024 by MediansSC (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

When stop sign clicked
Jump to navigation Jump to search

The when stop sign clicked block is a hat block that runs after the stop sign is clicked. It is not in vanilla Scratch, due to being rejected.[1]

Example Uses

This block can be used to show thumbnails:

when @stopSign clicked::events hat
set backdrop/costume to (thumbnail v)::looks
broadcast [hide sprites v]

Workaround

This block can be worked around by detecting the timer (which does not stop after the project is stopped, meaning it will be greater than 0 when the project is stopped if continuously reset):

when gf clicked
broadcast [msg v] //this will be used to also run the script again after the stop sign is clicked
when I receive [msg v]
set [timer v] to [0] //this can be used if you want to keep track of the timer in the project.
forever
change [timer v] by (timer)
reset timer //this will always be reset
end
when [timer v] > (0)
broadcast [msg v]
code::grey

References