ID:164300
 
Im trying to make a rest command which will make it so you can only press it once and rest, and so you can't move while rest, this is the code I have:

Rest()
set category = "Training"
if(Ftg >= 100)
usr << "You don't need to rest!"
else
src.frozen = 1
usr << "You begin to rest."
src.rest = 1
sleep(Baseftg/5)
src.Ftg = src.Baseftg
usr << "You are done resting."
src.frozen = 0
src.rest = 0

If someone can help me and tell me whats wrong, I'd be much obliged! ^^
This should allow you to disable movement via the client by setting the mob's 'canmove' var to 0. This'll only work for client input, though. If you want to lock computer-controlled mobs, you'll have to do that through their AI.

client
Move()
if(src.mob.canmove)
return ..()

mob
var/canmove = 1