ID:179560
 
Here's the code:

mob/proc
npcdeathcheck(mob/P as mob, mob/M as mob)
if (M.hp <= 0)
P << "You have killed the [M]!"
sleep(10)
del (M)
P.exp += M.expreward
P << "You gain [M.expreward] exp !"
sleep(10)
P << "You found [M.wealthreward] gold !"
P.wealth += M.wealthreward
sleep(10)
endbattle(P)
else
npcattack1(P, M)

Now, I want the monster to disappear once he's dead,
but because the del(M) isn't at the end, it doesn't work.
The game stops once I reach the del(M) part.
Is there a way to hide "M" while the deathcheck is in progress ?

Thx.
M.Move(null) should do it... or M.loc = null

However, since the experience stuff that happens after M is deleted "belongs" to the attacker rather than M, perhaps you should put it in its own proc that could be spawned for the attacker right before M is deleted. Either way would work, but this way would make everything a bit more self-contained.