This script seems to never work.
If anyone has a fixed version, PM me.
I will have to work with it later... :blink:
<event type="kill" name="monsterPortals" [B][COLOR="Red"]event="script"[/COLOR][/B] value="script.lua"/>
tp = doCreateTeleport(1387, pos, position)
addEvent(doRemoveItem, tpTime * 1000, tp, 1)
You gotta do something more like..Remere said:All items change UID between script callbacks. Items are assigned new UIDs each time they're used the first time in a callback.
The only items that retain UID are those with UIDs < 65000 (assigned on map).
local tp = doCreateTeleport(1387, pos, position)
addEvent(doRemoveItem, tpTime * 1000, getTileItemById(position, 1387).uid)
The Forgotten Server 0.3.5
Credits:
JDB
data/creaturescripts/scripts/login.lua
Lua:registerCreatureEvent(cid, "monsterPortals")
data/creaturescripts/creaturescripts.xml
Lua:<event type="kill" name="monsterPortals" event="script" value="script.lua"/>
data/creaturescripts/scripts/script.lua
Lua:local bosses = {-- Teleport To Position ["Morgaroth"] = { x=100, y=100, z=7 }, ["Orshabaal"] = { x=100, y=100, z=7 }, ["Ghazbaran"] = { x=100, y=100, z=7 } } local tpTime = 30 -- Seconds function onKill(cid, target, lastHit) local position = getCreaturePosition(target) for name, pos in pairs(bosses) do if name:lower() == getCreatureName(target):lower() then doCreateTeleport(1387, pos, position) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. tpTime .." seconds until the portal will disapear.") addEvent(doRemoveItem, tpTime * 1000, getTileItemById(position, 1387).uid, 1) end end return true end