ID:144369
 
Code:
mob/proc
attack_back(Mob/M as mob in oview(1))
if(M.attacked == 1)
attack()


Problem description: ok I thought this would work and make the attacked person retaliate by attacking back. but it doesn't
I have an attack verb and all and I am really pooped right now so please help me, my goal is to have a mob that attacks back when you (or anything for that matter) attacks it. to accomplish this I was going to use a variable called attacked and made a proc that says (/\ look above) and then then it would start attacking the thing that hit it. but it is not working. there are no errors.


ok someone please help this is really stating get me pee'd I just want my guys to attack back when they get attacked.
<dm>
mob
proc
attack_back()
for(var/mob/M in oview(1,src))
if(M.attacked==1)
attack(src,M)
attack(src,mob/M)
// put your attack stuff here. src is the NPC; M is the player...
You never even supplied your attack proc/verb. Also your ugly posted code won't even compile, I'm afraid (and no, not because of the screwed identation)...