JKBisms

So, I'm making an animation, and there is an intended result that won't work. The code looks something like this:

when green flag clicked
if <(costume #) = [17]> then
play sound [punch v]
end

Why won't this work?

Can you help me?

RokCoder

It's always better to actually share your project but from that little snippet it looks like you need to wrap the script in a forever loop (and probably change it to play sound until done otherwise it's going to stutter).

JKBisms

It doesn't stutter, It doesn't play at all, but I will try.

JKBisms

RokCoder wrote:

It's always better to actually share your project but from that little snippet it looks like you need to wrap the script in a forever loop (and probably change it to play sound until done otherwise it's going to stutter).

It worked

ItsFoxy87

a thing i learned from the past is ALWAYS do
forever
if <...> then
...
end
end
If you dont, scratch will think you want to do your “if” block once.

vcokltfre

ItsFoxy87 wrote:

a thing i learned from the past is ALWAYS do
forever
if <...> then
...
end
end
If you dont, scratch will think you want to do your “if” block once.
Maybe not always, consider carefully if you need a forever loop and what's in it because it can bring down the framerate a lot.
(Try maybe using broadcasts?)

JKBisms

OK NO NEED TO ADD ANY MORE POSTS!! THE ISSUE IS FIXED!!!

codeman1044

Or using
 forever
wait until <...>
...
That's a lot less laggy.

PinkTabbyHunterLargo

JKBisms wrote:

OK NO NEED TO ADD ANY MORE POSTS!! THE ISSUE IS FIXED!!!
i'd suggest closing this to avoid necroposts and spamming.