mob
proc
moveRun(i)
if(i)
if(stamina > 5)
state = STATE_RUN
move_speed *= speed
accel += 2
world << output("Running.", "chat")
else if(!i)
if(state == STATE_RUN)
state = STATE_NULL
move_speed /= speed
accel -= 2
while(state == STATE_RUN)
lastRun = world.time
staminaChange(0, 5)
world << output("[usr] has [stamina] stamina. Stamina percentage is [round(stamina/maxStamina * 100)].","chat")
sleep(20)
Problem description:
If I were to run, stop running, then start before the sleep(20) ends - it will create two instances of the loop. How would I resolve this?