ID:264908
 
Code:
mob/Enemy
Soldier
icon='Base.dmi'
Str=5
atack=0
New()
AI()
proc/AI()
walk
step(src, pick(NORTH,SOUTH,EAST,WEST))
//walk_rand(src,15)
for(var/mob/M in oview(9))
if(M.npc)
..()
goto walk
else
step_towards(src,M)
goto lol
lol
if(src.atack==0)
return
else
for(var/mob/M in oview(2))
src.atack=1
var/damage= src.Str+10
M.hp-=damage
view()<<"[damage]!"
src.atack=0
goto walk


Problem description: My npc does not attack, you could help me?
Thanks


Where you have src.atack = 1, it never gets a chance to reach that, as it's always 0. You need to make src.atack equal 1 before that if statment.
You have no need to use goto like that.