mob
proc
attack()
var/mob/M
for(M in get_step(src,src.dir))
if(istype(M,/mob/))
while(M in view(src.range))
while(M in get_step(src,src.dir))
var/damage=round((round(src.attack*2.5)-M.defense)/2)
if(M != get_step(src,src.dir))
break
if(damage<0)
damage=0
src<<"You attack [M] for [damage]."
if(M.hp<=0)
deathCheck(M)
break
sleep(src.delay)
else
world<<"Not a player."
Problem description:
This is causing my game to freeze up and crash. How do I fix this?
Simple. You learn to properly code loops. >.> You should go ahead and try by rewriting that small block o' code.