ID:142975
 
i need help adding a damage into it when i fire ther is no damagemob
proc
shoot() //name of proc
if(!src.fired) //if the usred fired is 0 (keeps the usr from holding down 5 for lots of shots)
src.fired = 1 //makes fired equal 1
spawn(15) //waits 1.5 seconds before going to the code underneath it
src.fired = 0 //makes the player's fired 0 so the player can shoot again
var/obj/H = new/obj/bullet //set the bullet to H (H is the bullet)
H.dir = src.dir //the bullets(H) direction equals the player's direction
H.loc = src.loc //the bullets(H) location equals the player's location
while(H) //while the bullet is still "alive"
var nextLocation = get_step(H,H.dir) //grabs the location of H's next move
var/turf/T = nextLocation //for the turf that is in H's next location
for(var/mob/M as mob in T) //for and M in that turf
if(M == src) //if that M is the person who fired, it continues as if nothing was there
continue
src<<"You shot [M]!" //says you shot M
//Here is where you would want to add damage or such ect..
del(H) //deletes the bullet
if(T.density == 1) //if that turfs density = 1 (ex: a wall)
del(H) //deletes the bullet
if(H) //if H exists
step(H,H.dir)//H steps towards H's direction
sleep(1) //sleeps 1/10th of second before re-doing the loop





i need help adding a damage in as when i shoot someone theres no damage
how about

var/dmg = round(how you want)
blahblah.hp -= dmg?

o.o
In response to Pirata Inmortal
Do not make multiple topics.

Phail.