Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » The if block isn’t working
- stalebell510042
-
9 posts
The if block isn’t working

if <> then
end
Is not working, I tried using this script:
when I receive [Join v]
if <key [s v] pressed?> then
say [Hello, welcome to the shop] for (2) secs
end
The code does not work whatsoever this is a piece of an important game I am constantly updating called ScratchBlox.
You can check it out in my profile but how do I use this block?
Last edited by stalebell510042 (Feb. 20, 2025 09:52:29)
- deck26
-
1000+ posts
The if block isn’t working
That script will only check for the key being pressed in the split second after the broadcast was made. I suspect you want it to start checking repeatedly for the s key being pressed after the broadcast. That is best done with
OR
forever
if <key [ v] pressed?> then
end
end
OR
wait until <key [ v] pressed?>
- stalebell510042
-
9 posts
The if block isn’t working
That script will only check for the key being pressed in the split second after the broadcast was made. I suspect you want it to start checking repeatedly for the s key being pressed after the broadcast. That is best done withforever
if <key [ v] pressed?> then
end
end
ORwait until <key [ v] pressed?>
Thank you bro
- Discussion Forums
- » Help with Scripts
-
» The if block isn’t working