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

Inlcuding unlockable places to my teleport scroll!

calveron

Bravemansworld
Joined
Feb 5, 2008
Messages
165
Reaction score
13
Location
Sweden
Hi folks! I have a town teleport scroll on my server. When using a book it opens up a window:
Tp_book.png

What I want is, when you click on Edron for example, it opens a new window that shows the locations that you've unlocked. Example: When walking close to cyclopolis you unlock that location. I've already added the storages and the movements for that.
Here is my Tp scroll script:
Code:
function onModalWindow(cid, modalWindowId, buttonId, choiceId)

if modalWindowId == 2 then


local player = Player(cid)

local thais = {x = 32369, y = 32241, z = 7}
local carlin = {x = 32360, y = 31782, z = 7}
local venore = {x = 32957, y = 32076, z = 7}
local ab = {x = 32732, y = 31634, z = 7}
local liberty = {x = 32317, y = 32826, z = 7}
local port = {x = 32594, y = 32745, z = 7}
local ankrahmun = {x = 33194, y = 32853, z = 7}
local darashia = {x = 33213, y = 32454, z = 1}
local kazordoon = {x = 32649, y = 31925, z = 11}
local edron = {x = 33217, y = 31814, z = 8}
local svargrond = {x = 32212, y = 31132, z = 7}
local yalahar = {x = 32787, y = 31276, z = 7}
local farmine = {x = 33023, y = 31521, z = 11}
local gray = {x = 33447, y = 31323, z = 9}
local roshamuul = {x = 33513, y = 32363, z = 6}
local trainers = {x = 32682, y = 32484, z = 7}

if buttonId == 2 then
return false
else
    if choiceId == 1 then
player:teleportTo(thais)
return true
    end
    if choiceId == 2 then
player:teleportTo(carlin)
return true
    end
    if choiceId == 3 then
player:teleportTo(venore)
return true
    end
    if choiceId == 4 then
player:teleportTo(ab)
return true
    end
    if choiceId == 5 then
player:teleportTo(liberty)
return true
    end
    if choiceId == 6 then
player:teleportTo(port)
return true
    end
    if choiceId == 7 then
player:teleportTo(ankrahmun)
return true
    end
    if choiceId == 8 then
player:teleportTo(darashia)
return true
    end
    if choiceId == 9 then
player:teleportTo(kazordoon)
return true
    end
    if choiceId == 10 then
player:teleportTo(edron)
return true
    end
    if choiceId == 11 then
player:teleportTo(svargrond)
return true
    end
    if choiceId == 12 then
player:teleportTo(yalahar)
return true
    end
    if choiceId == 13 then
player:teleportTo(farmine)
return true
    end
    if choiceId == 14 then
player:teleportTo(gray)
return true
    end
    if choiceId == 15 then
player:teleportTo(roshamuul)
return true
    end
    if choiceId == 16 then
player:teleportTo(trainers)
return true
    end
  
    end
end
end
Code:
local towns = {
    "Thais",
    "Carlin",
    "Venore",
    "Ab'dendriel",
    "Liberty Bay",
    "Port Hope",
    "Ankrahmun",
    "Darashia",
    "Kazordoon",
    "Edron",
    "Svargrond",
    "Yalahar",
    "Farmine",
    "Gray Beach",
    "Roshamuul",
    "Trainers"
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
        player:sendCancelMessage("PZ locked!")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return true
    end

    local modalWindow = ModalWindow(2, "Destination", "Make your choice:")
    for i = 1, #towns do
        modalWindow:addChoice(i, i .. ". " .. towns[i])
    end

    modalWindow:addButton(1, 'Go')
    modalWindow:setDefaultEnterButton(1)
    modalWindow:addButton(2, 'Exit')
    modalWindow:setDefaultEscapeButton(2)

    modalWindow:sendToPlayer(player)
    player:registerEvent("Destination")
    return true
end
Basicly, I want to merge https://otland.net/threads/tfs-1-1-...ablo-3-teleport-great-for-rpg-servers.230015/ with my tp scroll.

If anyone is up for this task it would be awesome. I tried to do it but it only gets bugs for me. (not the smartests)
 
Back
Top