Problem solved
action script:
creaturescript:
action script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
local Destination = ModalWindow(2, "Destination", "Make your choice:")
Destination:addChoice(1, "1. Thais")
Destination:addChoice(2, "2. Carlin")
Destination:addChoice(3, "3. Venore")
Destination:addChoice(4, "4. Ab'dendriel")
Destination:addChoice(5, "5. Liberty Bay")
Destination:addChoice(6, "6. Port Hope")
Destination:addChoice(7, "7. Ankrahmun")
Destination:addChoice(8, "8. Darashia")
Destination:addChoice(9, "9. Kazordoon")
Destination:addChoice(10, "10. Edron")
Destination:addChoice(11, "11. Svargrond")
Destination:addChoice(12, "12. Yalahar")
Destination:addChoice(13, "13. Farmine")
Destination:addChoice(14, "14. Gray Beach")
Destination:addChoice(15, "15. Roshamuul")
Destination:addButton(1, 'Go')
Destination:addButton(2, 'Exit')
Destination:sendToPlayer(player)
else
doPlayerSendCancel(cid, "PZ locked!")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return true
end
creaturescript:
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}
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
end
end
end
Last edited: