Ao invés de usar function onDeath, eu usaria o function onKill, e desta maneira:
local monster = {
[1] = { name = "Energy Soul", storage = 6640 },
[2] = { name = "Mazoran", storage = 6641 },
[3] = { name = "Brother Freeze", storage = 6642 },
[4] = { name = "Fleshcrawler", storage = 6643 },
}
function onKill(cid, target, lastHit)
local time = os.time()
if not isPlayer(target) then
for i = 1, #monster, 1 do
local name, storage = monster[i].name, monster[i].storage
if getCreatureName(target) == name then
if getPlayerStorageValue(cid, storage) <= time then
setPlayerStorageValue(cid, storage, time + (48 * 60 * 60))
doCreatureSay(cid, "I killed the " .. name .. "!", TALKTYPE_ORANGE_1)
end
end
end
end
return true
end