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

Ani do not teleport

SixNine

Active Member
Joined
Dec 12, 2018
Messages
484
Reaction score
46
Hi,
so installed this ani script which works sorta it ask for players it detects if someone is below x level and etc the only think that do not work is that it doesn't teleport which makes no sense when pos x,y,z is correct, so basically you press on lever and nothing happens it do not teleport you, then if you press it again it says that someone is in the quest
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] = Position(1101, 1405, 11),
    [2] = Position(1103, 1405, 11),
    [3] = Position(1102, 1409, 11),
    [4] = Position(1104, 1409, 11),
    [5] = Position(1105, 1407, 11),
    [6] = Position(1106, 1407, 11)
}

local pull_pos = Position(543, 722, 7)

local duration = 30 -- in minutes

local function resetAnnihilator(uid)
    local item = Item(uid)
    if item.itemid == 1946 then
        item:transform(1945)
    end
    for i = 1, #demons do
        local creatures = Tile(demons[i]):getCreatures()
        for key, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
    for key, value in pairs(positions) do
        local creatures = Tile(value.toPosition):getCreatures()
        for k, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        local players = {}
        for i = 1, #positions do
            if positions[i].fromPosition == pull_pos and player:getPosition() ~= pull_pos then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are in the wrong position.')
                return false
            end

            local creature = Tile(positions[i].fromPosition):getBottomCreature()
            if creature then
                local temp_player = creature:getPlayer()
                if not temp_player then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, creature:getName()..' is not a valid participant.')
                    return false
                end

                if temp_player:getLevel() < 200 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Some players are under the required level 200.')
                    return false
                end
               

                players[#players + 1] = temp_player
            end
        end

        if #players ~= 4 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You do not have the required amount of players.')
            return false
        end

        for i = 1, #players do
            local temp_player = players[i]
            if creature then
                players[i]:teleportTo(positions[i].toPosition)
                positions[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
            end
        end

        for i = 1, #demons do
            doSummonCreature('Demon', demons[i], false, true)
        end
       
        item:transform(1946)
        addEvent(resetAnnihilator, duration*60*1000, item.uid)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Someone has recently started this quest, the cooldown is '..duration..' minutes.')
        return false
    end
    return true
end
 
Solution
Hi,
so installed this ani script which works sorta it ask for players it detects if someone is below x level and etc the only think that do not work is that it doesn't teleport which makes no sense when pos x,y,z is correct, so basically you press on lever and nothing happens it do not teleport you, then if you press it again it says that someone is in the quest
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] =...
Hi,
so installed this ani script which works sorta it ask for players it detects if someone is below x level and etc the only think that do not work is that it doesn't teleport which makes no sense when pos x,y,z is correct, so basically you press on lever and nothing happens it do not teleport you, then if you press it again it says that someone is in the quest
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] = Position(1101, 1405, 11),
    [2] = Position(1103, 1405, 11),
    [3] = Position(1102, 1409, 11),
    [4] = Position(1104, 1409, 11),
    [5] = Position(1105, 1407, 11),
    [6] = Position(1106, 1407, 11)
}

local pull_pos = Position(543, 722, 7)

local duration = 30 -- in minutes

local function resetAnnihilator(uid)
    local item = Item(uid)
    if item.itemid == 1946 then
        item:transform(1945)
    end
    for i = 1, #demons do
        local creatures = Tile(demons[i]):getCreatures()
        for key, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
    for key, value in pairs(positions) do
        local creatures = Tile(value.toPosition):getCreatures()
        for k, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        local players = {}
        for i = 1, #positions do
            if positions[i].fromPosition == pull_pos and player:getPosition() ~= pull_pos then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are in the wrong position.')
                return false
            end

            local creature = Tile(positions[i].fromPosition):getBottomCreature()
            if creature then
                local temp_player = creature:getPlayer()
                if not temp_player then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, creature:getName()..' is not a valid participant.')
                    return false
                end

                if temp_player:getLevel() < 200 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Some players are under the required level 200.')
                    return false
                end
             

                players[#players + 1] = temp_player
            end
        end

        if #players ~= 4 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You do not have the required amount of players.')
            return false
        end

        for i = 1, #players do
            local temp_player = players[i]
            if creature then
                players[i]:teleportTo(positions[i].toPosition)
                positions[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
            end
        end

        for i = 1, #demons do
            doSummonCreature('Demon', demons[i], false, true)
        end
     
        item:transform(1946)
        addEvent(resetAnnihilator, duration*60*1000, item.uid)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Someone has recently started this quest, the cooldown is '..duration..' minutes.')
        return false
    end
    return true
end
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] = Position(1101, 1405, 11),
    [2] = Position(1103, 1405, 11),
    [3] = Position(1102, 1409, 11),
    [4] = Position(1104, 1409, 11),
    [5] = Position(1105, 1407, 11),
    [6] = Position(1106, 1407, 11)
}

local pull_pos = Position(543, 722, 7)

local duration = 30 -- in minutes

local function resetAnnihilator(uid)
    local item = Item(uid)
    if item.itemid == 1946 then
        item:transform(1945)
    end
    for i = 1, #demons do
        local creatures = Tile(demons[i]):getCreatures()
        for key, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
    for key, value in pairs(positions) do
        local creatures = Tile(value.toPosition):getCreatures()
        for k, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        local players = {}
        for i = 1, #positions do
            if positions[i].fromPosition == pull_pos and player:getPosition() ~= pull_pos then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are in the wrong position.')
                return false
            end

            local creature = Tile(positions[i].fromPosition):getBottomCreature()
            if creature then
                local temp_player = creature:getPlayer()
                if not temp_player then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, creature:getName()..' is not a valid participant.')
                    return false
                end

                if temp_player:getLevel() < 100 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Some players are under the required level 100.')
                    return false
                end
               

                players[#players + 1] = temp_player
            end
        end

        if #players ~= 4 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You do not have the required amount of players.')
            return false
        end

        for i = 1, #players do
            local temp_player = players[i]
            if temp_player then
                players[i]:teleportTo(positions[i].toPosition)
                positions[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
            end
        end

        for i = 1, #demons do
            doSummonCreature('Demon', demons[i], false, true)
        end
       
        item:transform(1946)
        addEvent(resetAnnihilator, duration*60*1000, item.uid)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Someone has recently started this quest, the cooldown is '..duration..' minutes.')
        return false
    end
    return true
end
 
Solution
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] = Position(1101, 1405, 11),
    [2] = Position(1103, 1405, 11),
    [3] = Position(1102, 1409, 11),
    [4] = Position(1104, 1409, 11),
    [5] = Position(1105, 1407, 11),
    [6] = Position(1106, 1407, 11)
}

local pull_pos = Position(543, 722, 7)

local duration = 30 -- in minutes

local function resetAnnihilator(uid)
    local item = Item(uid)
    if item.itemid == 1946 then
        item:transform(1945)
    end
    for i = 1, #demons do
        local creatures = Tile(demons[i]):getCreatures()
        for key, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
    for key, value in pairs(positions) do
        local creatures = Tile(value.toPosition):getCreatures()
        for k, creature in pairs(creatures) do
            if creature:getName() == "Demon" then
                creature:remove()
            end
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        local players = {}
        for i = 1, #positions do
            if positions[i].fromPosition == pull_pos and player:getPosition() ~= pull_pos then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are in the wrong position.')
                return false
            end

            local creature = Tile(positions[i].fromPosition):getBottomCreature()
            if creature then
                local temp_player = creature:getPlayer()
                if not temp_player then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, creature:getName()..' is not a valid participant.')
                    return false
                end

                if temp_player:getLevel() < 100 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Some players are under the required level 100.')
                    return false
                end
              

                players[#players + 1] = temp_player
            end
        end

        if #players ~= 4 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You do not have the required amount of players.')
            return false
        end

        for i = 1, #players do
            local temp_player = players[i]
            if temp_player then
                players[i]:teleportTo(positions[i].toPosition)
                positions[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
            end
        end

        for i = 1, #demons do
            doSummonCreature('Demon', demons[i], false, true)
        end
      
        item:transform(1946)
        addEvent(resetAnnihilator, duration*60*1000, item.uid)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Someone has recently started this quest, the cooldown is '..duration..' minutes.')
        return false
    end
    return true
end
What about if i want to add different monster names?
 
So it will spawn just one name monsters, if there is like multiply creatures with different names
Part of the process in building stuff is experimenting, exploring, counting on things not working right 100% of the time.
I am a little disturbed by your question so I am not going to answer it and I hope in this thread at least, no one else does either.
 
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] = {pos = Position(1101, 1405, 11), name = "Demon"},
    [2] = {pos = Position(1103, 1405, 11), name = "Rat"},
    [3] = {pos = Position(1102, 1409, 11), name = "Dragon Lord"},
    [4] = {pos = Position(1104, 1409, 11), name = "Dragon"},
    [5] = {pos = Position(1105, 1407, 11), name = "Demon"},
    [6] = {pos = Position(1106, 1407, 11), name = "Demon"},
}

local pull_pos = Position(543, 722, 7)

local duration = 30 -- in minutes

local function resetAnnihilator(uid)
    local item = Item(uid)
    if item.itemid == 1946 then
        item:transform(1945)
    end
    for i = 1, #demons do
        local creatures = Tile(demons[i].pos):getCreatures()
        for key, creature in pairs(creatures) do
            if creature:getName() == demons[i].name then
                creature:remove()
            end
        end
    end
    for key, value in pairs(positions) do
        local creatures = Tile(value.toPosition):getCreatures()
        for k, creature in pairs(creatures) do
            if creature:getName() == demons[i].name then
                creature:remove()
            end
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        local players = {}
        for i = 1, #positions do
            if positions[i].fromPosition == pull_pos and player:getPosition() ~= pull_pos then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are in the wrong position.')
                return false
            end

            local creature = Tile(positions[i].fromPosition):getBottomCreature()
            if creature then
                local temp_player = creature:getPlayer()
                if not temp_player then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, creature:getName()..' is not a valid participant.')
                    return false
                end

                if temp_player:getLevel() < 200 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Some players are under the required level 200.')
                    return false
                end
              

                players[#players + 1] = temp_player
            end
        end

        if #players ~= 4 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You do not have the required amount of players.')
            return false
        end

        for i = 1, #players do
            local temp_player = players[i]
            if creature then
                players[i]:teleportTo(positions[i].toPosition)
                positions[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
            end
        end

        for i = 1, #demons do
            doSummonCreature(demons[i].name, demons[i].pos, false, true)
        end
      
        item:transform(1946)
        addEvent(resetAnnihilator, duration*60*1000, item.uid)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Someone has recently started this quest, the cooldown is '..duration..' minutes.')
        return false
    end
    return true
end
 
Last edited:
LUA:
local positions = {
    {fromPosition = Position(543, 716, 7), toPosition = Position(539, 762, 8)},
    {fromPosition = Position(539, 717, 7), toPosition = Position(554, 762, 8)},
    {fromPosition = Position(547, 717, 7), toPosition = Position(569, 762, 8)},
    {fromPosition = Position(543, 721, 7), toPosition = Position(585, 762, 8)}
}

local demons = {
    [1] = {pos = Position(1101, 1405, 11), name = "Demon"},
    [2] = {pos = Position(1103, 1405, 11), name = "Rat"},
    [3] = {pos = Position(1102, 1409, 11), name = "Dragon Lord"},
    [4] = {pos = Position(1104, 1409, 11), name = "Dragon"},
    [5] = {pos = Position(1105, 1407, 11), name = "Demon"},
    [6] = {pos = Position(1106, 1407, 11), name = "Demon"},
}

local pull_pos = Position(543, 722, 7)

local duration = 30 -- in minutes

local function resetAnnihilator(uid)
    local item = Item(uid)
    if item.itemid == 1946 then
        item:transform(1945)
    end
    for i = 1, #demons do
        local creatures = Tile(demons[i].pos):getCreatures()
        for key, creature in pairs(creatures) do
            if creature:getName() == demons[i].name then
                creature:remove()
            end
        end
    end
    for key, value in pairs(positions) do
        local creatures = Tile(value.toPosition):getCreatures()
        for k, creature in pairs(creatures) do
            if creature:getName() == demons[i].name then
                creature:remove()
            end
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        local players = {}
        for i = 1, #positions do
            if positions[i].fromPosition == pull_pos and player:getPosition() ~= pull_pos then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are in the wrong position.')
                return false
            end

            local creature = Tile(positions[i].fromPosition):getBottomCreature()
            if creature then
                local temp_player = creature:getPlayer()
                if not temp_player then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, creature:getName()..' is not a valid participant.')
                    return false
                end

                if temp_player:getLevel() < 200 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Some players are under the required level 200.')
                    return false
                end
             

                players[#players + 1] = temp_player
            end
        end

        if #players ~= 4 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You do not have the required amount of players.')
            return false
        end

        for i = 1, #players do
            local temp_player = players[i]
            if creature then
                players[i]:teleportTo(positions[i].toPosition)
                positions[i].toPosition:sendMagicEffect(CONST_ME_TELEPORT)
            end
        end

        for i = 1, #demons do
            doSummonCreature(demons[i].name, demons[i].pos, false, true)
        end
     
        item:transform(1946)
        addEvent(resetAnnihilator, duration*60*1000, item.uid)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Someone has recently started this quest, the cooldown is '..duration..' minutes.')
        return false
    end
    return true
end
Well it do not teleport you to a quest now, and it doesnt spawn monsters. Mistakes after mistakes
 
use this new script, made by apollo
 
Back
Top