That suggestion has a flaw: If you start moving with the arrow keys, then hold any other key (such as Z) and release the arrow, the sprite will keep animating. You only want to stop the animation if none of the arrow keys are being held.
You could do that with either:
if pressd=false && pressu=false && pressl=false && pressr=falseOr, as I would prefer:
if pressd=true {
image_speed=0.5
// code here to walk down
} else if pressu=true {
image_speed=0.5
// code here to walk up
} else if pressl=true {
image_speed=0.5
// code here to walk left
} else if pressr=true {
image_speed=0.5
// code here to walk right
} else {
image_index= 0
image_speed= 0
}
What that does is check through the four keys in order, only checking each condition if the one before it was false. So if you aren't holding down, up, left, or right, then do the stopping code. NOTE: That example is very basic and doesn't account for diagonal movement, so you may want to go with the first suggestion instead.
Also, please read my post
here for some important info on how to use curly brackets with conditions.