ID:139754
 
Code:
                    sucAILookFriendly()
for(var/inView in view(5,src))
if(istype(inView,/mob/demon))
src.target=inView
return
if(istype(inView,/mob/human))
world << "..."


sucAIAttackFriendly()
if(get_dist(src,target)<=1)
target:health-=4
if(target:health<=0)
if(istype(target,/mob/human))
del(target)
if(istype(target,/mob/demon))
del(target)
if(get_dist(src,target)>1)
walk_towards(src,target,10)

sucAIMainFriendly()
while(src)
if(behavior=="Follow")
if(target)
sucAIAttackFriendly()
if(!target)
sucAILookFriendly()
if(target)
sucAIAttackFriendly()
if(!target)
walk_towards(src,leader,10)
sleep(10)


Problem description:
The problem is that this isn't working. What the precise problem is that when it's friendly, it doesn't chase and pursue it's target. Please help. It would appear that the target is not being returned, tell me would it not work if they were the same type?
It's because you are using walk_towards(). Every time it's about to take a step, another walk_towards() command overrides it and blocks it. Use step_towards() instead.

And a lot of your if() statements should be else if()s.