dgprado
Member
I need a script to open teleport in local x when monster x dies.
For TFS 1.1
For TFS 1.1
http://otland.net/threads/how-to-kill-a-boss-and-make-a-teleport-appear.201231/#post-1935477
To change to TFS 1.0 functions you can use compat.lua as example
https://github.com/otland/forgottenserver/blob/master/data/compat.lua
If you need help with it post it.
I did some random attempts, no idea what to do, ;/Post your script how you changed it and the problems.
just post your scriptI did some random attempts, no idea what to do, ;/
just post your script
local config = {
["bossname"] = {time = 60, toPos = {x = 100, y = 100, z = 7}, tpPos = {x = 100, y = 100, z = 7}}
}
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
local config = {
["bossname"] = {time = 60, toPos = Position(100, 100, 7), tpPos = Position(100, 100, 7)}
}
local function deleteTeleport(position)
local teleport = Tile(position):getItemById(1387)
if teleport then
teleport:remove()
position:sendMagicEffect(CONST_ME_POFF)
end
end
function onKill(creature, target)
local monster = config[target:getName():lower()]
if not monster or target:isPlayer() then
return true
end
local item = Game.createItem(1387, 1, monster.tpPos)
if item:isTeleport() then
item:setDestination(monster.toPos)
end
creature:say("You have " .. monster.time .. " seconds to enter the teleport!", TALKTYPE_MONSTER_SAY)
addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
return true
end