ID:166692
 
mob
verb
Rest()
if(usr.resting == 0)
usr.resting = 1
usr<<"You begin to rest!"
overlays += 'Rest.dmi'
usr.walk = 1
rest()
else
usr.resting = 0
usr.walk = 0
usr<<"Your done resting!"
overlays -= 'Rest.dmi'


mob
proc
rest()
if(usr.resting==1)
sleep 25
usr.health = usr.mhealth
usr.chakra = usr.mchakra
usr.rest()
else
..()



I dont no why my rest verb isnt stoping on its own.. i have to click rest again for it to stop when it should be stoping itself... any suggestions?
The rest() proc should use src, not usr, firstly. Secondly, ..() is pointless in mob/proc/rest(), unless you've got an atom/proc/rest() or datum/proc/rest(), or something silly like that - which I doubt.

Now, here's the thing - why would you think it's stopping itself? It most certainly does not.

Once it gets into this bit:

sleep(25) //Shouldn't even compile without the brackets there
usr.health = usr.mhealth
usr.chakra = usr.mchakra
usr.rest()


It will just keep looping until something makes src.resting 0. If you want it to stop after 25 seconds, just call Rest(). DM is case-sensitive - rest() is different to Rest(). One note, though - you should set usr to src before calling Rest().

And finally, instead of if(usr.resting==0), you should have if(!resting). And if(usr.resting==1) should be if(resting)
In response to Jp
Thanks Alot!! worked perfectly!
In response to Expty
No use usr is proc. Agh.
In response to Dark Weasel
Jp already said that. =P

O-matic