ID:262651
 
Code:
turf
trainwater
icon='scenery.dmi'
icon_state="waterfall01"
Entered()
usr.waterfall()
Exited()
return


mob/proc/waterfall()
src.hp-=10
usr.Deathcheck()
src.maxhp+=10
src<<"You gain some Max Hp and lose some HP."
spawn(100) src.waterfall()


Problem description:why is it that u are like in a never ending cycle even when u get off the turf ur still gaining stats. Help?

According to your coding, there is no stop, no matter what the proc will be called every 10 seconds (you should use while for something like that btw...)

Maybe do something like this:
turf
trainwater
icon='scenery.dmi'
icon_state="waterfall01"
Entered(mob/M)
if(!M.client||!ismob(M))return 0//only if 'M' is a mob and client (incase).. note that usr is not used here do to user abuse potentials... I think >.>
M.inwaterfall=1
M.waterfall()
Exited(mob/M)
if(M.inwaterfall) M.inwaterfall=0

mob/proc/waterfall()
set background = 1
while(src.inwaterfall)//while this var is true
src.hp-=10
src.Deathcheck()
src.maxhp+=10
src<<"You gain some Max Hp and lose some HP."
sleep(100)


I know I messed up something...
In response to GhostAnime
how would i define inwaterfall?

edit: if its suppost to be mob/var/inwaterfall then it doesnt work and it does the same thing.