ID:141710
 
Code:
mob
verb
Clone()
set category="Spells"
var/mob/clone=new(src.loc)
clone.icon=src.icon
clone.overlays=src.overlays
clone.currenthp = 1
if(clone.currenthp<=0)
del clone


Problem description:The problem with this section of code is, once the clone has been killed it is not deleted, instead it is sent to the location of 6,6,2. Im not sure what I have done wrong and any help will be greatly appreciated.

I suppose you have an override on Del() for mobs that does that instead of the default function.
mob
verb
Clone()
// (...)
clone.currenthp = 1
if(clone.currenthp<=0)
del clone


You set the clones currenthp var(iable) to 1, then check if it's less than 0, which is not true, thus the next statement, del clone, is not called.

You'd have to check for the clones death in a different way and in a different place (either where you reduce it's "currenthp", or during the "attack" itself).
In response to Schnitzelnagler
Ahh, I see now, I have got it working properly now. Thanks for the help.