ID:272319
 
I was wondering how I would make this code so that right when you touch it you automatically get killed and you spawn.

    black
icon = 'black.dmi'
name = ""
Entered(mob/a)
if(istype(a,/mob/))
walk(usr,x+2)
usr.loc = locate(11,14,1)
usr.inair = 0
if(usr.kills >0)
usr.kills -= 0.5
else
..()
obj/instakill
density = 1

Bump(mob/m)
if(istype(m) && m.client) //I don't know if you want
//NPCs to die too.
m.Respawn()

mob/proc/Respawn()
//Respawning would best be handled in its own proc, as
//it will be referred to a lot.
loc = locate(11, 14, 1)
inair = 0

if(usr.kills > 0) usr.kils -= 0.5

Also, you're using usr in Entered(). Never use usr in procs, but especially never use it in movement-related procs. That's a no-no of the highest order.
In response to Popisfizzy
Tried it, Got an error, Bump: Undefined proc

    obj/black
icon = 'black.dmi'
density = 1

Bump(mob/m)
if(istype(m) && m.client) //I don't know if you want
m.loc = locate(11,14,1)
m.inair = 0
if(m.kills >0)
m.kills -= 0.5
In response to Element Hero creator
Er, whoops.
atom
//Called when the object is bumped into. I'm simply
//setting up what the argument would be.
proc/Bumped(atom/bumper)

movable/Bump(atom/obstacle)
..()
obstacle.Bumped(src) //Calls Bumped() for the
//obstacle.

obj/instakill
Bumped(mob/m)
if(istype(m) && m.client)
m.Respawn()

I still suggest you handle respawning in a /mob proc.
In response to Popisfizzy
...

And YOU'RE using usr in Respawn(), which is a proc. For heightened irony: it's a prime example of why you SHOULDN'T be using usr in such procs.
In response to Garthor
Yea, I totally screwed up when writing that. Except for the usr part, I don't know what I was thinking when I wrote that. About the usr part, I was copying from his code and missed replacing usr with the proper variable (which is just making it kills).