ID:267692
 
i have this code;

mob/slime
icon = 'monsters.dmi'
icon_state = "slime"

New()
.=..()
spawn(1) MovePath()
proc/MovePath()
step(src,EAST)
sleep(10)
step(src,EAST)
sleep(10)
step(src,EAST)
sleep(10)
step(src,WEST)
sleep(10)
step(src,WEST)
sleep(10)
step(src,WEST)
spawn(10) MovePath()
Bump(mob/M)
if(istype(M,/mob))
usr.loc = locate(2,4,1)

but it does not move the player back to the start, it moves the slime, what is wrong?

thanks.
Replace usr with M.
In response to Unknown Person
that worked, but the monster does not stick to it's set path when it bumps in the the player it moves one square to right, every time it bumps.
In response to Mousie_kebabs
When it bumps, it doesnt move, and considers the step proc already called. In the bump proc, add: step(src,src.dir)
so it will step its direction after bumping. (add that at the end)
That should do the trick...
In response to JackGuy
Don't put usr in procs.
In response to Jon88
Jon88 wrote:
Don't put usr in procs.

Wrong.

No put usr in proc. Ungh.
In response to HavenMaster
thanks everyone it works now :-)