ID:141409
 
Code:
turf
Treadmill
icon = 'Training.dmi'
Entered(mob/M)
if(prob(50))
if(!M.Full_Access)
if(istype(M,/mob/Player))
spawn(5) walk(M,WEST)
M.mpl += rand(1,7)
M.exp += rand(1,3)
M.LevelUp()
else
if(istype(M,/mob/Player))
spawn(5) walk(M,WEST)
M.mpl += rand(1,10)
M.exp += rand(1,3)
M.LevelUp()
else
if(istype(M,/mob/Player))
spawn(5) walk(M,WEST)
Exited(mob/Player/M)
if(istype(M,/mob))walk(M,0)


Problem description:
When you get on the treadmill everything works right, but when you get off of it you keep moving WEST, can someone help me fix this error.

turf
Treadmill
icon = 'Training.dmi'
Entered(mob/M)
if(istype(M,/mob/Player))
walk(M,WEST,5)

if(prob(50))
if(!M.Full_Access)
M.mpl += rand(1,7)
else
M.mpl += rand(1,10)
M.exp += rand(1,3)

M.LevelUp()

Exited(mob/M)
if(istype(M,/mob/Player))
walk(M,0)



The problem was the use of spawn as a delay. When you run across multiple of them, it stacks the spawns and starts calling them even if you're not on the treadmill anymore.
In response to T3h P3ngu1n
Ahhhh, thanks ALOT, that one has been bugging me for a long time.