• 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 Multi Boss Create Teleport tfs 1.2

beenii

Well-Known Member
Joined
Jul 26, 2010
Messages
586
Solutions
1
Reaction score
58
i try modify inquisition script.

Code:
local bosses = {
   ['[Tower] Feroxa'] = {storage = 20000, posx = 32363, posy = 32204, posz = 6, dposx = 32217, dposy = 32189, dposz = 6},
   ['[Tower] Demon'] = {storage = 20000, posx = 32363, posy = 32204, posz = 6, dposx = 32217, dposy = 32189, dposz = 6}    ------------> crear y borrar > teleporter
}

function onKill(player, target)
   local targetMonster = target:getMonster()
   if not targetMonster then
      return true
   end

   local targetName = targetMonster:getName():lower()
   local bossSelect = bosses[targetName]
   local bossStorage = bosses[targetName].storage
   if not bossStorage then
      return true
   end
      local function deleteTeleport(position)
                            local teleport = Tile(position):getItemById(1387)
                            if teleport then
                                teleport:remove()
                               
                            end
                        end
  

   local newValue = 2
  
   Game.setStorageValue(bossStorage, newValue)
  
   local item = Game.createItem(1387, 1,{x = bossSelect.posx, y = bossSelect.posy, z = bossSelect.posz}) ------> donde se creara
                            if item:isTeleport() then
                                item:setDestination({x = bossSelect.dposx, y = bossSelect.dposy, z = bossSelect.dposz}) ------> donde te teleportara
                            end

   if newValue == 2 then
      player:say('You now have 1 minutes to exit this room through the teleporter. It will bring you to your reward.', TALKTYPE_MONSTER_SAY)
      addEvent(deleteTeleport, 1 * 60 * 1000, {x = bossSelect.posx, y = bossSelect.posy, z = bossSelect.posz}) ------> donde lo removera
   end
   return true
end


i have this error:

2lawjeb.png
 
Solution
will this do what you want?
LUA:
local timer = 4*60*1000
local bosses = {'Ferumbras' = Position(1000,1000,7), 'Orshabaal' = Position(1500,1500,7)}
function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if isInArray(bosses,cid:getName()) then
        corpse:remove()
        local teleport = Game.createItem(1387,1,corpse:getPosition())
        teleport:setDestination(bosses[cid:getName()])
        addEvent(function()
            teleport:remove()
        end,timer)
    end
end
make sure to add create event in monster xml
I try create teleport in specific área on kill BOSS, i want add any number Of bosses with diferent teleport position, example: Demon create teleport in Thais, rat create teleport in venore, troll in kaz, etc.
 
Probably better to do with onDeath, is there any reason you tried to do this with onKill?
 
No have reason for onkill only i ser script inquisition ando have onkill i add positions and teleport in script Of inquisition
 
will this do what you want?
LUA:
local timer = 4*60*1000
local bosses = {'Ferumbras' = Position(1000,1000,7), 'Orshabaal' = Position(1500,1500,7)}
function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if isInArray(bosses,cid:getName()) then
        corpse:remove()
        local teleport = Game.createItem(1387,1,corpse:getPosition())
        teleport:setDestination(bosses[cid:getName()])
        addEvent(function()
            teleport:remove()
        end,timer)
    end
end
make sure to add create event in monster xml
 
Last edited:
Solution
will this do what you want?
LUA:
local bosses = {'Ferumbras' = Position(1000,1000,7), 'Orshabaal' = Position(1500,1500,7)}
function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if isInArray(bosses,cid:getName()) then
        corpse:remove()
        local teleport = Game.createItem(1387,1,corpse:getPosition())
        teleport:setDestination(bosses[cid:getName()])
    end
end
make sure to add create event in monster xml

how add event in monster? and how remove teleport in x time?
 
Oops sorry, I fixed it
put
XML:
<script>
   <event name="bossdeath"/>
</script>
in the boss monster xml
and in creaturescripts.xml
XML:
<event type="death" name="bossdeath" script="bossdeath.lua" />
 
i have this error xD
206cz76.png


my creature events xml and monster xml:
1zf4izc.png


i solved, thanks bro
 
Last edited by a moderator:
Back
Top