Resolvendo seu problema onde ao matar o monstro só quem fragava recebia o storage:
local tps = {
["hyaena"] = {pos = {x=349, y=1103, z=15}, toPos = {x = 518, y = 840, z = 7}, time = 10, storage = 46000},
}
local storage = 46000
local function removeTp(tp)
local t = getTileItemById(tp.pos, 5023).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(tp.pos, CONST_ME_POFF)
end
function onDeath(cid, corpse, deathList, frompos, topos)
local tp = tps[getCreatureName(cid)]
if tp then
doCreateTeleport(5023, tp.toPos, tp.pos)
doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tp.time*1000, tp)
for _, check in pairs(deathList) do
if isPlayer(check) then
setPlayerStorageValue(check, tp.storage, 5)
end
end
end
return true
end
registra no creaturescripts:
<event type="death" name="Storage" event="script" value="seuarquivo.lua"/>
registra no arquivo.xml do boss:
<script>
<event name="Storage"/>
</script>