mob
General
verb/Punch()
set category="Unarmed"
for(var/mob/X in range(1))
if(get_dir(src,X))
if(src.punchcooldown==0)
if(src.canattack==1)
if(X.attackable==1)
src.damage=src.unarmed
src.attacking=pick(90;1,10;2)
if(src.attacking==1)
src<<"You punch [X.name] for [src.damage]."
X.hp -= src.unarmed
X.npcdeathcheck()
src.punchcooldown=1
spawn(20)src.punchcooldown=0
if(src.attacking==2)
src<<"You punch [X.name] for [src.unarmed*2]!"
X.hp -= src.unarmed*2
X.npcdeathcheck()
src.punchcooldown=1
spawn(20)src.punchcooldown=0
else
src<<"You can't attack that!"
else
src<<"Your attacks have been disabled!"
else
src<<"That power is on cooldown."
Problem description: It works just fine at first, but then, long after the player has walked away, it repeats the messages 'You punch so and so for something!'. I don't know how to fix this, so I would appreciate help.