shootp()
set name = "Shoot - Pistol"
if(usr.Pistol == 1)
set src in view(5)
del(src)
usr << "You shoot the thug. He clutches his chest and falls to the ground"
new /obj/thug1corpse(src.loc)
return ..()
The obj is deleted but the corpse isnt created.
help plz, thx.
ID:178682
Apr 17 2002, 9:43 pm
|
|
When you delete an object(not an obj, mind you) all procedures currently running are terminated. Solution: Delete the object at the very end.
Alathon |
In response to Nadrew
|
|
still doesnt work and it looks like this now
shootp() set name = "Shoot - Pistol" if(usr.Pistol == 1) set src in view(5) del(src) usr << "The thug falls to the ground in a bloody heap. You killed a member of the Mob D gang - boy your in for it now!" new /obj/thug1corpse(src.loc) del(src) return ..() |
In response to Akarat
|
|
oh i forgot to remove the 1st del(src) i get it now
thx for your help. |
One other thing you may find helpful: Create a corpse based on the icon of the thing you kill, so you only need a single corpse class instead of thug1corpse, thug2corpse, etc.:
obj/corpse Now when you create a corpse for the src object, all you have to do is this:
new /obj/corpse(src.loc,src)
Lummox JR |
del(src) halts the proc, move the del(src) part to after where you create the corpse.