Powtreeman
Member
I have this monster portal transfered from my 9.6 server to my 1.0 but it doesn't work. No errors or anything but here it is.
Code:
local config = {
["ferumbras"] = {time = 60, toPos = {x = 1000, y = 1000, z = 7}, tpPos = {x = 915, y = 1096, z = 0}}
}
local function deleteTeleport(tp)
local teleport = getTileItemById(tp, 1387).uid
if(teleport > 0) then
doRemoveItem(teleport)
doSendMagicEffect(tp, CONST_ME_POFF)
end
return true
end
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if(isPlayer(target) or not monster) then
return true
end
doCreateTeleport(1387, monster.toPos, monster.tpPos)
doCreatureSay(cid, "You have "..monster.time.." seconds to enter the teleport!", TALKTYPE_ORANGE_1)
addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
return true
end