Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Why does my wait block not have any wait?
- soninjanathanchin
-
Scratcher
8 posts
Why does my wait block not have any wait?
I was coding a new game and trying to make a delay on how quick you can shoot. The wait block suddenly had no wait and wouldn't work. Can anybody help me.
This is the code I used:
This is the code I used:
when I receive [ Start]
forever
if <key [Space v] pressed?> then
create clone of [myself v]
wait (0.6) secs
end
end
- Spentiline
-
Scratcher
100+ posts
Why does my wait block not have any wait?
It's because clones can receive broadcasts and every clone is running that code.
If what I suggested doesn't work, you will have to provide more information.
If what I suggested doesn't work, you will have to provide more information.
- WindowsAdmin
-
Scratcher
1000+ posts
Why does my wait block not have any wait?
Because it's in a loop. Do this
... :: hatThen in another forever loop
if <<key [space v] pressed> and <(my variable) = [0]>> then
create clone of [myself v]
end
... :: cap
forever
if <(my variable) = [1]> then
wait (0.6) secs
set [my variable v] to [0]
end
end
- soninjanathanchin
-
Scratcher
8 posts
Why does my wait block not have any wait?
The start only broadcasts when the start button is clicked and the start button hides itself when it is pressed.
- soninjanathanchin
-
Scratcher
8 posts
Why does my wait block not have any wait?
My code for the start button is:
when this sprite clicked
broadcast [ Start]
hide
when green flag clicked
show
- soninjanathanchin
-
Scratcher
8 posts
Why does my wait block not have any wait?
Also, It is supposed to be a loop, so if space is pressed at any time, it summons a bullet.
- amogus1123
-
Scratcher
500+ posts
Why does my wait block not have any wait?
I was coding a new game and trying to make a delay on how quick you can shoot. The wait block suddenly had no wait and wouldn't work. Can anybody help me.put wait 0.6 before the create clone block.
This is the code I used:when I receive [ Start]
forever
if <key [Space v] pressed?> then
create clone of [myself v]
wait (0.6) secs
end
end
- deck26
-
Scratcher
1000+ posts
Why does my wait block not have any wait?
That'll just delay the next clone in an annoying way.I was coding a new game and trying to make a delay on how quick you can shoot. The wait block suddenly had no wait and wouldn't work. Can anybody help me.put wait 0.6 before the create clone block.
This is the code I used:when I receive [ Start]
forever
if <key [Space v] pressed?> then
create clone of [myself v]
wait (0.6) secs
end
end
Best if you share the project so we can check what you have.
- Discussion Forums
- » Help with Scripts
-
» Why does my wait block not have any wait?