Rikutachimoto 8 Postado Novembro 26, 2013 Share Postado Novembro 26, 2013 (editado) 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, 2013 por Rikutachimoto Link para o comentário https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/ Compartilhar em outros sites More sharing options...
0 Killua 389 Postado Novembro 26, 2013 Share Postado Novembro 26, 2013 (editado) 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"/> Editado Novembro 26, 2013 por amoeba13 Link para o comentário https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/#findComment-1585991 Compartilhar em outros sites More sharing options...
0 Zikaduh 12 Postado Novembro 26, 2013 Share Postado Novembro 26, 2013 tenta fazer um armengo com issa função pra set uma storage pra da tempo (não so script mas to querendo aprender kkk) if getPlayerStorageValue(cid, 10005) > os.time() thendoPlayerSendCancel(cid, "Você tem que esperar "..getPlayerStorageValue(cid, 10005) - os.time().." segundos para sabe os teleport.") return false endreturn doCombat(cid, acombat, var) and setPlayerStorageValue(cid, 10005, os.time() + 7) Link para o comentário https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/#findComment-1586016 Compartilhar em outros sites More sharing options...
0 Killua 389 Postado Novembro 26, 2013 Share Postado Novembro 26, 2013 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] local cooldown = 5 -- Tempo em segundos para poder se teleportar novamente. 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 if getPlayerStorageValue(cid, 23121) > os.time() then return doPlayerSendCancel(cid, "Vo deve esperar mais " .. getPlayerStorageValue(cid, 23121) - os.time() .. " segundos para se teleportar novamente.") end doPlayerSetStorageValue(cid, 23121, os.time() + cooldown) 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 Nao coloquei cooldown pq ele nao tinha pedido... Link para o comentário https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/#findComment-1586022 Compartilhar em outros sites More sharing options...
0 Rikutachimoto 8 Postado Novembro 26, 2013 Autor Share Postado Novembro 26, 2013 Obrigado amoeba13. REP+ Link para o comentário https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/#findComment-1586024 Compartilhar em outros sites More sharing options...
0 Omega 377 Postado Novembro 26, 2013 Share Postado Novembro 26, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/#findComment-1586045 Compartilhar em outros sites More sharing options...
Pergunta
Rikutachimoto 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 por RikutachimotoLink para o comentário
https://xtibia.com/forum/topic/224519-tabela-item-de-teleporte/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados