ID:172143
 
If I shoot a bullet, I want it to check if it is a mob, if it is it does M.HP -= 1 but if its just a turf it deleteds itself.

obj/Bullet
icon = 'Misc.dmi'
icon_state = "shot"
var/inair = 0
Bump()


obj/Bullet
icon = 'Misc.dmi'
icon_state = "shot"
var/inair = 0
Bump(atom/M) // M is what the bullet bumps
if(ismob(M)) //check if its a mob
M.HP-=1
else //if its not a mob delete it
del src


In the above it will also delete the bullet if it hits anything dense that is not a mob.

To change what happens to different things look up the following in the reference (or hit F1 in DreamMaker).
ismob()
isobj()
isturf()
istype()