Siegh
Thronar Developer
I'm having a problem with this script. I've tried doing similarly as an onKill too but I ended up with the same issue. It works fine when I test it, but when I kill a lot of these monsters at the same time, the server crashes.
Any possible reason and/or fix?
Code:
function onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
chance = math.random(1,100)
timer = math.random(2000,4000)
pos = creature:getPosition()
if chance <= 20 then
addEvent(doCreatureSay, timer, creature, "<Clink, Clank>", TALKTYPE_ORANGE_1)
addEvent(Game.createMonster, timer, "Skeleton Minion", pos)
addEvent(doSendMagicEffect, timer, pos, 60)
local function removeMinion()
corpse:remove(1)
end
addEvent(removeMinion, timer)
else
return false
end
end
Any possible reason and/or fix?