• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua [8.6] After killing the monster appears to teleport

Gohut

New Member
Joined
May 12, 2011
Messages
73
Reaction score
0
Hello,
I am looking for a script where after you kill the monster appears and displays a teleport sign that the teleport is closed for 15 seconds. This monster is on the quest for 5 people so it would be nice if this inscription was displayed just for those 5 people.

Thanks for your help;)

(sorry for my english)
 
Code:
local tpId = 1387
local tps = {
        ["Ghazbaran"] = {pos = {x=970, y=1194, z=9}, toPos = {x=970, y=1194, z=10}, time = 15},
}

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, "Run before the teleport disappears in "..tp.time.." seconds.", TALKTYPE_ORANGE_1)
                addEvent(removeTp, tp.time*1000, tp)
        end
        return TRUE
end

in pos you need to put the posxyz where the teleport will be added, and in topos you need to put the coordinates of the TP that will appear.

add this in creaturescripts.xml:

Code:
<event type="death" name="RemoveTP" script="removetp.lua"/>

this in login.lua:

Code:
registerCreatureEvent(cid, "RemoveTP")

and finally, this in the monster.xml file (after </flags>)

Code:
  <script>
    <event name="RemoveTP"/>
  </script>

and for the people, you can easily configure a annihi lever script, good luck.
 
Back
Top