Aqui manim ! (Creditos do Vodkart)
Va em data/creaturescript\script e crie um arquivo .lua com nome tp e adicione o script abaixo dentro !
local tpId = 1387
local tps = {
["Orshabaal"] = {pos = {x=761, y=57, z=7}, toPos = {x=767, y=52, 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)
doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tp.time*1000, tp)
end
return TRUE
end
Agora adicione no creaturesscript.xml essa tag:
<event type="death" name="tp" event="script" value="tp.lua"/>
No arquivo.xml do seu monstro adicione:
<script>
<event name="tp"/>
</script>
explicação:
["Orshabaal"] --------- Nome do monstro
pos = {x=761, y=57, z=7} ----------- onde o Teleport irá abrir
toPos = {x=767, y=52, z=7} ------- onde o teleport vai leva eles
time = 30 ------------ tempo em segundos que o teleport ficará aberto