ID:166429
 
Hello I am going through my game for buggs currently I found one, When I'm lifting weights that slowly takes down stamina, I found out you can rest at the same time, which means unlimited Training.


I've tried a few codes to stop it, but I've been unsuccessful

 bj
weight
layer=MOB_LAYER+1
verb
Lift()
set category="Training"
set src in oview(0)
if(usr.lifting)
usr.lifting = 0
usr << "You stop lifting."
src.icon_state = "weights"
return
if(usr.stamina >= 1)
usr.lifting = 1
usr << "You Start lifting."
src.icon_state = "lifting weight"
while(usr.lifting)
sleep(10)
usr.stamina -= rand(1,3)
usr.strength += rand(0.70,0.75)
if(usr.stamina<=0)
usr.stamina = 0
usr.lifting = 0
src.icon_state = "weights"
usr << "You have no more energy!"
if(usr.resting)
usr << "You can't rest whilst lifting."
usr.resting = 0
return
if(usr.stamina<=0)
usr.lifting = 0
usr << "You are too tired. Try Resting."





as you can see in this part of the code is where I tried to work my magic


 while(usr.lifting)
sleep(10)
usr.stamina -= rand(1,3)
usr.strength += rand(0.70,0.75)
if(usr.stamina<=0)
usr.stamina = 0
usr.lifting = 0
src.icon_state = "weights"
usr << "You have no more energy!"
if(usr.resting)
usr << "You can't rest whilst lifting."
usr.resting = 0
return



Thanks for reading.
mob
verb/lift()
if(doing_stuff) return
doing_stuff = 1
verb/rest()
if(doing_stuff) return
doing_stuff = 1
In response to DivineO'peanut
And this will stop me from resting whilst lifting??
In response to Nexus6669
Yes, just don't forget to set doing_stuff to 0 when you stop lifting, resting