elnelson
Lunaria World Dev
Hello, im sharing this scripts made by me, hope help you
creaturescripts.xml
login.lua
creaturescripts/scripts/teleport_window.lua
actions/script/teleport_window.lua
actions.xml
When u click an item with uniqueid "xxxx" it popUp a modal window with the destinations
creaturescripts.xml
Code:
<event type="modalwindow" name="tpw" script="teleport_window.lua"/>
Code:
player:registerEvent("tpw")
Code:
local pos1 = {x=135, y=53, z=5}
local pos2 = {x=50, y=80, z=7}
function onModalWindow(cid, modalWindowId, buttonId, choiceId, item, position, pos, toPosition, fromPosition, itemEx)
if modalWindowId == 1901 and choiceId == 1 then
doPlayerSendTextMessage(cid, 18, "You have joined Team PvP")
doTeleportThing(cid, pos2, true)
return true
end
if modalWindowId == 1901 and choiceId == 2 then
doPlayerSendTextMessage(cid, 18, "You have joined Solo PvP")
doTeleportThing(cid, pos1, true)
return true
end
end
Code:
function onUse(cid, words, position, Toposition)
local player = Player(cid)
local modal = ModalWindow (1901, "Ultimate PvP Warper", "Make your choice:")
modal:addChoice(1, "Team PvP")
modal:addChoice(2, "Solo PvP")
if modal:getId() == 1901 then
modal:addButton(3, "Select")
modal:addButton(4, "Cancel")
end
modal:sendToPlayer(player)
return true
end
Code:
<action uniqueid="xxxx" script="teleport_window.lua"/>
When u click an item with uniqueid "xxxx" it popUp a modal window with the destinations