ID:272663
 
client/Move()
mob.Run()
..()

mob/proc/Run()
var/time = world.realtime
if(lastmove>time*10)
icon_state="run"
move_delay=3
lastmove += time
spawn(14)
lastmove-=time
if(lastmove<time*8)
icon_state=""
move_delay=7


The game sort of freezes for like a split second when I change direction, so there has to be a better way.
What exactly are you trying to do?
In response to Jeff8500
Toggle between walking and running if you hold down a direction key for a while.

And if you let go of the key it toggles back to walking.
In response to Andre-g1
//you will need to really adapt this to get what you want

#define RUNNING 1

mob/var/speed

mob/verb/Locomotion()
spawn(whatever you want)
if(key_down) speed = RUNNING
while(key_down)
Move(whatever)

mob/proc/key_down()
key_down = 1
Locomotion()

mob/proc/key_up() key_down = null


Then you set your macros to key up and key down. I recommend using Kakashi24142's key handling library to prevent certain key lifts from not registering.