Discuss Scratch

NamePending_
Scratcher
100+ posts

Adding parameters to broadcasts

Is it possible to make a broadcast in Scratch that has parameters like a custom block? For example:
broadcast [do thing v] (1) :: control 
If this doesn't make sense, let me know and I'll try to elaborate.

Last edited by NamePending_ (Jan. 14, 2024 23:34:34)

cookieclickerer33
Scratcher
1000+ posts

Adding parameters to broadcasts

variables
Invisible_Factory
Scratcher
500+ posts

Adding parameters to broadcasts

U can always set a variable to the parameter and then use that parameter from a different sprite or wherever you are receiving the broadcast.

<sprite1>
when green flag clicked
set [x v] to [5]
broadcast [message1 v]

<sprite2>
when I receive [message 1 v]
say (x) for (2) secs
NMario84
Scratcher
1000+ posts

Adding parameters to broadcasts

I mean…. In theory, you “COULD” set up a custom block to do broadcasting in the way you want it to. You would just use a regular broadcast block inside/under the custom block that you are making to make it happen in such a way.

Though I imagine the workarounds would so just fine as well.
NamePending_
Scratcher
100+ posts

Adding parameters to broadcasts

Thank you guys for the help!

Powered by DjangoBB