Por
M4G0
Boa Noite pessoal, tentei sem sucesso criar dois scripts para o fly um para players não vip's e outro para vips porem não consigo fazer funcionar
a talckaction
function onSay(player, words, param)
local places, options =
{"Vip Mordigan",
"Vip Stoneplains Center",
"Vip Stoneplains West",
"Vip Stoneplains East",
"Vip Tirana",
"Vip Tanaris",
"Vip Tanaris Center",
"Vip Hell City",
"Vip Goroma"}, -- places
{"Travel", "Cancel"} -- options
local modalWindow = ModalWindow(4597, "List of places", "Select your destiny:")
for w = 1, #places do
modalWindow:addChoice(w, places[w])
end
-- Select
modalWindow:addButton(1, options[1])
modalWindow:setDefaultEnterButton(1)
-- Cancel
modalWindow:addButton(2, options[2])
modalWindow:setDefaultEscapeButton(2)
-- Send window
modalWindow:sendToPlayer(player)
return false
end
<talkaction words="!vip" script="viptalk.lua"/>
<talkaction words="!go" script="flytalk.lua"/>
creaturescript
function onModalWindow(player, modalWindowId, buttonId, choiceId)
if(modalWindowId ~= 4597 or buttonId == 2) then
return false
end
if(not getTileInfo(player:getPosition()).protection) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You can only fly in protection zone.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
local positions = {
[33] = {x = 5208, y = 6100, z = 6}, -- Vip Mordigan
[34] = {x = 5688, y = 6141, z = 7}, -- Vip Stoneplains Center
[35] = {x = 5563, y = 6208, z = 7}, -- Vip Stoneplains West
[36] = {x = 5705, y = 6193, z = 7}, -- Vip Stoneplains East
[37] = {x = 5653, y = 5796, z = 7}, -- Vip Tirana
[38] = {x = 5811, y = 5784, z = 7}, -- Vip Tanaris
[39] = {x = 6018, y = 6041, z = 6}, -- Vip Tanaris Center
[40] = {x = 5755, y = 5706, z = 6}, -- Vip Hell City
[41] = {x = 31848, y = 32691, z = 8} -- Vip Goroma
}
player:teleportTo(positions[choiceId])
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
<event type="modalwindow" name="fly" script="fly.lua"/>
<event type="modalwindow" name="flyvip" script="flyvip.lua"/>
os dois scripts são iguais so muda os destinos e
if(modalWindowId ~= 4596 or buttonId == 2) then e o outro if(modalWindowId ~= 4597 or buttonId == 2) then
Alguem pode ajudar
Posts Recomendados
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.