ID:149081
 
This code makes the user attack the M, not the object, but the object should be the one
mob
verb
Fire(mob/M as mob in oview(10))
new/obj/spl_projectile(usr.loc)
walk_towards(src,M,0)
Drafonis wrote:
This code makes the user attack the M, not the object, but the object should be the one

You need to tell it to walk the projectile to the target.

mob
verb
Fire(mob/M as mob in oview(10))
<font color=#ffffa0>var</font>/obj/ spl_projectile/<font color=#ffffa0>P = new</font>(usr.loc)
walk_towards(<font color=#ffffa0>P</font>,M,0)
In response to Shadowdarke
Shadowdarke wrote:
Drafonis wrote:
This code makes the user attack the M, not the object, but the object should be the one

You need to tell it to walk the projectile to the target.

mob
verb
Fire(mob/M as mob in oview(10))
<font color=#ffffa0>var</font>/obj/ spl_projectile/<font color=#ffffa0>P = new</font>(usr.loc)
walk_towards(<font color=#ffffa0>P</font>,M,0)

Thanks, but I fixed this problem using missile()