• 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!

TFS 1.X+ boss teleport

janes123

New Member
Joined
Jun 21, 2012
Messages
100
Reaction score
4
Lua:
local timer = 4*60*1000
local bosses = {'Deathstrike' = Position(1564,1161,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
error:

Code:
[Warning - Event::checkScript] Can not load script: scripts/warzone/deathstriker.lua
data/creaturescripts/scripts/warzone/deathstriker.lua:2: '}' expected near '='
somebody know?
 
Solution
Lua:
local timer = 4 * 60 * 1000
local bosses = {
    ['Deathstrike'] = {pos = Position(1564,1161,7)}
}
function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if bosses[cid:getName()] then
        local teleport = Game.createItem(1387, 1, corpse:getPosition())
        corpse:remove()
        teleport:setDestination(bosses[cid:getName()].pos)
        addEvent(function()
            teleport:remove()
        end,timer)
    end
end
Lua:
local timer = 4 * 60 * 1000
local bosses = {
    ['Deathstrike'] = {pos = Position(1564,1161,7)}
}

function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if bosses[cid:getName()] then
        corpse:remove()
        local teleport = Game.createItem(1387,1,corpse:getPosition())
        teleport:setDestination(bosses[cid:getName()].pos)
        addEvent(function()
            teleport:remove()
        end,timer)
    end
end
 
Lua:
local timer = 4 * 60 * 1000
local bosses = {
    ['Deathstrike'] = {pos = Position(1564,1161,7)}
}

function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if bosses[cid:getName()] then
        corpse:remove()
        local teleport = Game.createItem(1387,1,corpse:getPosition())
        teleport:setDestination(bosses[cid:getName()].pos)
        addEvent(function()
            teleport:remove()
        end,timer)
    end
end
now
Lua:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/warzone/deathstriker.lua:onDeath
data/creaturescripts/scripts/warzone/deathstriker.lua:10: attempt to index local 'teleport' (a nil value)
stack traceback:
    [C]: in function '__index'
    data/creaturescripts/scripts/warzone/deathstriker.lua:10: in function <data/creaturescripts/scripts/warzone/deathstriker.lua:6>
 
Lua:
local timer = 4 * 60 * 1000
local bosses = {
    ['Deathstrike'] = {pos = Position(1564,1161,7)}
}
function onDeath(cid, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    if bosses[cid:getName()] then
        local teleport = Game.createItem(1387, 1, corpse:getPosition())
        corpse:remove()
        teleport:setDestination(bosses[cid:getName()].pos)
        addEvent(function()
            teleport:remove()
        end,timer)
    end
end
 
Solution
Back
Top