Eu fiz a talkaction pra vc mas quando vc fala !teleport repetidas vezes ele vai repetindo o nome dos lugares disponiveis... To tentando arrumar isso.
local positions = {
{lugar = "Midgard", pos = {x=123, y=123, z=7}},
{lugar = "Sao Paulo", pos = {x=123, y=123, z=7}},
{lugar = "Carlin", pos = {x=123, y=123, z=7}},
{lugar = "Venore", pos = {x=123, y=123, z=7}}
}
local str = ""
local needPz = false -- Precisa de pz? [true/false]
function onSay(cid, words, param, channel)
for i = 1, (#positions) do
local cidades = positions[i].lugar
str = str .. cidades .. '\n '
end
for _, abc in pairs(positions) do
if param == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Para se teleportar diga !teleport LUGAR.\nLugares disponiveis:\n " .. str .. "\n Escolha seu destino e boa viagem!")
end
if param == "" .. abc.lugar .. "" then
if needPz == true and getTilePzInfo(getCreaturePosition(cid)) == false then
doPlayerSendCancel(cid, "Voce precisa estar em PZ para teleportar.")
return true
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, abc.pos)
doPlayerSendTextMessage(cid, 25, "Bem vindo a " .. abc.lugar.. "!")
doSendMagicEffect(abc.pos, CONST_ME_TELEPORT)
end
end
return true
end
XML
<talkaction words="!teleport" event="script" value="teleport.lua"/>






info
Grupo: Artesão
Registrado: 24/11/13
Posts: 108
Reputação: +8
Olá gostaria de pedir, uma talkaction ao falar !teleport e teleportado para o local aonde o jogador escolher:
Quando jogador falar aparacer a mensagem no chat: Escolha um Local para ir:
Helgen
Midgard
Asgard
Ai e só falar !teleport Midgard, o player será teleportado para tal posição
QUEM PUDER AJUDAR REP+
Já consegui achar podem fexar.
Editado Novembro 26 por Rikutachimoto