obj/bullet
icon = 'bullet.dmi'
var/mob/owner
Bump(atom/A)
if(ismob(A))
var/mob/M=A
M.die(owner)
del(src)
New(newloc,mob/M)
owner=M
walk(src,owner.dir)
spawn(10)
del(src)
mob
proc/die(mob/killer)
if(killer)
world << "[killer] kills [src]!"
del(src)
Thats the code I found, and I need to know how to actually use this. Here is a gun I have made(I would like a person to be able to click on fire, then activate that above).
obj
Blade
icon = 'weapons.dmi'
icon_state = "blade"
verb
fire()
set desc = "Fire your weapon"
set category = "Commands"
if(usr.paint == 0)
usr << "Your hopper is empty, buy some paint!"
usr << 'handhit.wav'
else if(usr.air == 0)
usr << 'handhit.wav'
usr << "Your out of CO2, buy some more!"
else if(usr.fire == 1)
usr << 'handhit.wav'
usr << "You can't fire your weapon here."
else
view() << 'Clack.wav'
usr.paint -= 1
usr.air -= 0.1
<code>new /obj/bullet(usr.loc, usr)</code>
The overidden New() proc will then set the direction of the bullet and move it.
Remember to replace usr with something more appropriate, if necesssary.