ID:1635451
 
(See the best response by LordAndrew.)
monster
icon = 'player.dmi'
icon_state = "monster"
src.walking()
proc
walking(M as mob.client)
for(var/mob/m in oview(src))
if(m.client&&m.key)
get_dir(src,M.client)
get_step(src,src.dir)
while(get_dist(src,M.client)<=3)
walk_towards(src,M.client,5,8)

I tried this but it comes up with this error :
loading learning.dme
helllo world.dm:52:error: input type (mob.client) must be atomic (area, turf, obj, or mob).
learning.dmb - 4 errors, 0 warnings
Best response
mob.client is an invalid type to use with the as statement, though generally using as for a procedure argument is not good practice.
I would use istype for something like this but it looks like you haven't made a type for a player
just remove the M as mob.client and you'll need a couple sleep or spawns here and there so your game doesn't lag