Help with animation

id: 751498

category: Help with Scripts

posts: 1

I need help to stop my sprite's Idle Animation when they are using a move. I want it to go back once they are done with their move, here is the code:

define (Idle Animations)
forever
repeat until <key [ any] pressed?>
switch costume to [ Idle]
wait (0.1) secs
next costume
wait (0.1) secs
next costume
wait (0.1) secs
next costume
wait (0.1) secs
next costume
wait (0.1) secs
next costume
wait (0.1) secs
next costume
wait (0.1) secs
next costume
end
wait until <<not <key [ any] pressed?>
wait (5) secs
end

Thats the code for the Idle animation. Thank you