Olá, alguem poderia me ajudar nesse script, ele funciona certinho sem erros tals. mais eu queria que quando o monstro morresse.. nascesse o teleporte com a contagem regressiva em cima dele( 30, 29, 28...), ficarei muito grato se alguem me ajudasse.
creaturescript..
local tpId = 1387
local tps = {
["Zugurosh"] = {pos = {x=1478, y=879, z=7}, toPos = {x=1491, y=874, z=7}, time = 30},
}
function removeTp(tp)
local t = getTileItemById(tp.pos, tpId)
if t then
doRemoveItem(t.uid, 1)
doSendMagicEffect(tp.pos, CONST_ME_POFF)
end
end
function onDeath(cid)
local tp = tps[getCreatureName(cid)]
if tp then
doCreateTeleport(tpId, tp.toPos, tp.pos)
doBroadcastMessage("O Zugurosh foi morto. O teleporte irá desaparecer em "..tp.time.." segundos.", 19)
addEvent(removeTp, tp.time*1000, tp)
end
return TRUE
end