Discuss Scratch

pavcato
Scratcher
100+ posts

Broadcast once block

When I use an if/else inside a repeat and there's a broadcast in there, it keeps broadcasting and repeats the code under the broadcast received block. It should reset the one time execution when it switches from if to else and vice versa.



broadcast []once
(Supposed to be orange)

Last edited by pavcato (April 7, 2020 21:36:50)


My worst fear:

H'mm, what does this picture above link to?
Wyan100
Scratcher
100+ posts

Broadcast once block

Here is a simple workaround:

when green flag clicked
repeat (A bunch of times)
if <(Do Broadcast) = [True]> then
broadcast [Stuff]
set [Do Broadcast] to [False]
end
Do Stuff
end

“But don't quote me on it!” - Wyan100, 2020
Maximouse
Scratcher
1000+ posts

Broadcast once block

Another workaround:
forever
wait until <condition :: grey>
broadcast [message 1 v]
wait until <not <condition :: grey>>
broadcast [message 2 v]

This does the same thing as
forever
if <condition :: grey> then
broadcast [message 1 v] once :: events
else
broadcast [message 2 v] once :: events

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Powered by DjangoBB

Standard | Mobile