ID:177703
 
how would you make it so if someone gets killed by a projectile, the person who shot it gets 1 kill and a message to the world saying they killed whoever they killed?
Tazor07 wrote:
how would you make it so if someone gets killed by a projectile, the person who shot it gets 1 kill and a message to the world saying they killed whoever they killed?

Well, this depends on if your projectiles are dense. If they are...

obj/Weapon/Generic_Gun
Bump(mob/M)
if(istype(M, /mob))
..()
return
M.health -= M.dam // Assuming you have damage amounts on your guns
if(M.health < 1)
world << "[M.name] has been killed!"
del(src) // Delete the projectile, since it hit someone

Hope that helps.
In response to Malver
but i also want it to display the name of the killer and have them put 1 kill on their kill var
In response to Tazor07
Tazor07 wrote:
but i also want it to display the name of the killer and have them put 1 kill on their kill var

Then we'll need to remember who shot the projectile.

obj/Weapon/var/mob/owner  // Set this to the person who shot the projectile in your firing proc

obj/Weapon/Generic_Gun
Bump(mob/M)
if(istype(M, /mob))
..()
return
M.health -= M.dam // Assuming you have damage amounts on your guns
if(M.health < 1)
world << "[M.name] has been killed by [src.owner.name]!"
src.owner.kills++
del(src) // Delete the projectile, since it hit someone
In response to Malver
How would you set it up?
In response to Tazor07
Tazor07 wrote:
How would you set it up?

Set what up?
In response to Malver
the owner var so it keeps the key of the guy or whatever
In response to Tazor07
Tazor07 wrote:
the owner var so it keeps the key of the guy or whatever

In your firing proc...

O.owner = src  // Assuming src is the firer, and O is the projectile :P