zezin009
Member
- Joined
- May 30, 2019
- Messages
- 49
- Reaction score
- 24
Hello, I'm wonderying whats happend when a monster kills another monster...?
When I use the onKill function, it doesn't work in this case!
I already tried to use onDeath function, but I think i'm missing something to understand what it need to work.
I have TSF 0.3, and my code is something like this:
Notice that I want to make the Rat to explode after killing him!
The problem is, when the Rat is killed by another monster, this code don't run.
If the killer is a player, or his summon, it works.
Any ideas?
When I use the onKill function, it doesn't work in this case!
I already tried to use onDeath function, but I think i'm missing something to understand what it need to work.
I have TSF 0.3, and my code is something like this:
Lua:
function onKill(cid, target, lastHit)
if getCreatureName(target) == "Rat" then
doCombatAreaHealth(cid, COMBAT_FIREDAMAGE, getThingPosition(target), 3, -30, -50 , 5)
return true
end
Notice that I want to make the Rat to explode after killing him!
The problem is, when the Rat is killed by another monster, this code don't run.
If the killer is a player, or his summon, it works.
Any ideas?