ID:166541
 
i need 2 kno how to make an npc shoot bullets even if there is no1 near it
I'm not exactly sure why you want to do this, but this might work.
mob/npc/shooter
icon=whatevr
New()
..()
shootalways()
mob/proc/shootalways()
var/obj/bullet/b=new /obj/bullet(src.loc)
walk(b,src.dir)
b.dir=src.dir
spawn(10)//wait a second
shootalways()
obj
bullet
icon=whatever
density=1
Bump(mob/M)
if(istype(M,/mob/))
view()<<"[M] got shot and died, what a pitty..."
del(M)
del(src)
del(src)
In response to Evidence
ummm how can i put that here
mob
proc
invisshot()
set background=1
var/obj/H = new/obj/invisshot
if(src.fired == 0)
src.fired = 1
spawn()
src.fired = 0
H.dir = src.dir
H.loc = src.loc
while(H)
walk(H,H.dir)
var/turf/T = H.loc
if(T.density == 1)
del(H)
break
for(var/mob/M as mob in T)
if(M == src)
cannodumattack()




mob
proc
cannodumattack()
set background=1
var/obj/K = new/obj/cannodumattack
if(src.fired == 0)
src.fired = 1
spawn()
src.fired = 0
K.dir = src.dir
K.loc = src.loc
var/damage = 60
while(K)
walk(K,K.dir)
var/turf/F = K.loc
if(F.density == 1)
del(K)
break
for(var/mob/M as mob in F)
if(M == src)
continue
if(M.client)
M.hp -= damage
src <<"Cannodum hits [M] for [damage]!"
M <<"You are being attacked by [src]!"
src.level_up()
M.death_check(src)


i want the invisshot to keep shooting and if it hits a mob it shoots the cannodum attack to do damage
In response to Dazz513
I don't think i understand, you want it to hit a mob and then have the bullet spawn another bullet that does damage? Why not just make the bullet do damage?
In response to Evidence
cuz i want the npc to only attack in 1 direction the direction its facing so im using the invisshot to check if a mob is in front of it if the invisshot hits then it sends out the attack
have u played megaman battle network
i want my npc to be like the Cannodum
In response to Dazz513
this is an example

Photobucket - Video and Image Hosting
In response to Dazz513
can some1 plz help