obj
Food
Speed_Pills
icon='Items.dmi'
icon_state="Speed"
density=0
name="Speed Pills"
verb
Interact()
set src in oview(1)
usr << "You get the [src]!"
Move(usr)
verb
Eat()
if(usr.SpeedPill==0)
usr <<"You eat the [src]. You feel strange."
usr.HP-=15
sleep(5)
usr <<"You lose some health, but you feel great."
usr.damage+=15
usr.SpeedPill=1
del src
sleep(500)
usr.SpeedPill=0
usr.damage-=15
else
if(usr.SpeedPill==1)
usr<<"I wouldn't take anymore [src] if I were you."
Problem description: I have this item in my game called "Speed Pills". Basically, the user sacrifices a little bit of health to increase their attack for a set amount of time.
However, I think the timer stops when the player logs out. How could I go about making it that even if they log out it'll continue to countdown when they log back in?
Or, should I just set it to stop completely if someone logs out. IE, when they log back in they no longer have that buff.
You'd need to save existing buff timers and reapply them if you wanted buffs to persist through logout.