ID:167549
 
How would I go about making it where you can't change icon states while moving? In other words... I want to have a verb that changes the icon state (sort of like an attack), but I don't want it to be able to change while the character is moving.

if
..()
else
usr.icon_state = "bananas"

That's what I'm looking for.
mob
var/moved=0
Move()
..()
moved=1
sleep(2)
moved=0

if(moved) ..()
else usr.icon_state="bananas"
In response to CIB
I love you.
In response to CIB
CIB wrote:
    sleep(2)


That could be changed to be more accurate if you use sleep(32/pixel_step_size).

Also, if you move several times in a row, before the variable is set back to 0, it will mess up the movement detection. You can fix this by using moved+=1 and moved-=1 instead of moved=1 and moved=0.