mob
var/tmp/loop_num = 0
verb/rest()
if(src.action=="Resting")
src<<"You stop resting."
src.action="Nothing"
else if(src.action||src.Stamina>=src.MaxStamina && src.Chakra>=src.MaxChakra)
src<<"You don't need to rest yet."
else
src.action="Resting"
can_move = 0
loop_num++
var/my_loop_num = loop_num
while(my_loop_num == loop_num && action == "Resting")
src.Stamina+=5
src.Chakra+=5
icon_state = "rest"
if(src.Stamina>=src.MaxStamina)
src.Stamina=src.MaxStamina
if(src.Chakra>=src.MaxChakra)
src.Chakra=src.MaxChakra
src<<"You're done resting."
src.action="Nothing"
icon_state = ""
sleep(10)
Problem description: No copile errors and when I run it I use the verb it works but when i use some magic (which cost chakra) and try using rest verb and it won't let me it says you don't need to rest yet but it works 1 time when I try do it again after losing some chakra it doesn't could it be the loop var? need some help here.