Ir para conteúdo
  • Cadastre-se

(Resolvido)Npc que teleporta diferente


Ir para solução Resolvido por Rusherzin,

Posts Recomendados

Exemplo o player fica num x tile e digita o lugar que ele quer ir sem precisar do "hi"

ele precisa estar no tile se não ele não teleporta.

 

queria poder configurar naonde ele vai ser teleportado ou as citys exemplo "south florest" "iwagakure" "konoha" "mist" "suna" "desert florest"

 

ao chegar no tile ele fala "south florest"  e vai pra lá

 

esse npc só vai ter 1 nao ira ficar em todas as citys então só precisa de 1 tile.

 

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites

Okay, o npc não vai interagir com o player, né? Ele só vai estar ali, correto?

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites
20 minutos atrás, Rusherzin disse:

Okay, o npc não vai interagir com o player, né? Ele só vai estar ali, correto?

ss vai estar parado

ai o player fala a city,esqueci de falar que vai ter 1 npc que interagi tipo vc chega ele fala "ola player name voçe quer ser teleportado aonde exatamente ? aqui ele fala o local que tem pra teleportar" ele só fala as ilhas pra teleporta nada mais

----

ai o player vai no npc que teleporta e fala a Ilha sem interagir com ele. só fala a ilha.

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites
  • Solução

Okay, fiz um script aqui, só lembra de colocar ali na tabela posToGo o nome da ilha com todas letras minúsculas, os jogadores podem falar com letras maiusculas ou minúsculas, mas ali no código tem que estar com letras minúsculas.
 

local posToBe = {x=893, y=830, z=7}
local posToGo = {["konoha"] = {x=894, y=831, z=7},
		["ilha"] = {x=895, y=895, z=7}}

function onSay(cid, words, param)
	local playerpos = getCreaturePosition(cid)

	if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then
		return 
	end

	if(posToGo[string.lower(words)]) then
		doTeleportThing(cid, posToGo[string.lower(words)], true)
	end

end

No talkactions.xml tu bota uma tag assim:
 

<talkaction words="konoha;ilha" event="script" value="teleport.lua"/>

Separa o nome das ilhas por ; .

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites
4 minutos atrás, Rusherzin disse:

Okay, fiz um script aqui, só lembra de colocar ali na tabela posToGo o nome da ilha com todas letras minúsculas, os jogadores podem falar com letras maiusculas ou minúsculas, mas ali no código tem que estar com letras minúsculas.
 


local posToBe = {x=893, y=830, z=7}
local posToGo = {["konoha"] = {x=894, y=831, z=7},
		["ilha"] = {x=895, y=895, z=7}}

function onSay(cid, words, param)
	local playerpos = getCreaturePosition(cid)

	if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then
		return 
	end

	if(posToGo[string.lower(words)]) then
		doTeleportThing(cid, posToGo[string.lower(words)], true)
	end

end

No talkactions.xml tu bota uma tag assim:
 


<talkaction words="konoha;ilha" event="script" value="teleport.lua"/>

Separa o nome das ilhas por ; .

Krl Vlw mesmo,eu coloco esse script naonde? npc/script?

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites

Não, é uma talkaction, bota em talkactions/scripts/.

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites
Agora, Rusherzin disse:

Não, é uma talkaction, bota em talkactions/scripts/.

poderia criar 1 npc que simplesmente nao faça nada? é só pra combinar pq vai ter 1 sprite no local e é a sprite do npc.

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites

Só criar um XML com algo mais ou menos assim:
 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Rusherzin" script="default.lua" walkinterval="3000" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
	<parameter key="message_greet" value=""/>
</parameters>
</npc>

 

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites

NPC:

Gate Keaper.xml



<?xml version="1.0" encoding="UTF-8"?>
<npc name="Gate Keaper" script="travel.lua" walkinterval="0">
    <health now="100" max="100"/>
    <look type="466"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Digite o nome do local que deseja se teletransportar: {Earth}, {Sand City}, {M2}, {Tsufur}, {Zelta}, {Vegeta}, {Namek}, {Lude}, {Premia}, {Boar's Island}, {Ruudo}, {City 17}, {Gardia}."/>
    </parameters>
</npc>

 

travel.lua

 



local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'earth'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Earth}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, destination = {x=106, y=149, z=10} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
local travelNode = keywordHandler:addKeyword({'sand city'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Sand City}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, destination = {x=288, y=935, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Posso te teletransportar para: {Earth}, {Sand City}, {M2}, {Tsufur}, {Zelta}, {Vegeta}, {Namek}, {Lude}, {Premia}, {Boar's Island}, {Ruudo}, {City 17} e {Gardia}."})

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'m2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {M2}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=78, y=514, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'tsufur'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Tsufur}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=105, y=489, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'zelta'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Zelta}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=105, y=515, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'vegeta'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Vegeta}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=141, y=489, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'namek'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Namek}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=141, y=515, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'lude'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Lude}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=191, y=498, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'premia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Premia}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=191, y=524, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"boar's island"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {Boar's Island}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=75, y=488, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"ruudo"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {Ruudo}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=103, y=547, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"city 17"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {City 17}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=800, y=1133, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"gardia"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {Gardia}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=48, y=1274, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

 

so editar !

 

se quiser faço em  talkactions !

Link para o post
Compartilhar em outros sites
18 horas atrás, Rusherzin disse:

Okay, o npc não vai interagir com o player, né? Ele só vai estar ali, correto?

Vlw cara curti bastante o Script !! tem como criar outro Npc que fica falando sem interagir,ele fala a cada 6 segundos. 

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Walker" script="walkernpc.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100" />
	<look type="140" head="77" body="81" legs="79" feet="95" addons="0" />
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)			npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)		npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)		npcHandler:onCreatureSay(cid, type, msg)		end

local lastSound = 0
function onThink()
	if lastSound < os.time() then
		lastSound = (os.time() + 6)
		selfSay("MENSAGEM")
	end
	npcHandler:onThink()
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites
21 horas atrás, Rusherzin disse:

Só criar um XML com algo mais ou menos assim:
 


<?xml version="1.0" encoding="UTF-8"?>

<npc name="Rusherzin" script="default.lua" walkinterval="3000" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
	<parameter key="message_greet" value=""/>
</parameters>
</npc>

 

Erro

Spoiler

local posToBe = {x=1001, y=904, z=7}
local posToGo = {["konoha"] = {x=894, y=831, z=7},
		["south florest"] = {x=911, y=1179, z=7}},
		["suna"] = {x=563, y=1144, z=7}},
		["south island"] = {x=1086, y=1397, z=7}},
		["ilhazinha"] = {x=1100, y=1531, z=7}},
		["mist"] = {x=1145, y=1218, z=7}},
		["south desert"] = {x=1495, y=1052, z=7}}

function onSay(cid, words, param)
	local playerpos = getCreaturePosition(cid)

	if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then
		return 
	end

	if(posToGo[string.lower(words)]) then
		doTeleportThing(cid, posToGo[string.lower(words)], true)
	end

end

 

Spoiler

[21:59:05.738] [Error - LuaInterface::loadFile] data/talkactions/scripts/minouro.lua:4: unexpected symbol near '['
[21:59:05.739] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/minouro.lua)
[21:59:05.740] data/talkactions/scripts/minouro.lua:4: unexpected symbol near '['

 

 

19 horas atrás, matheusjp2 disse:

NPC:

Gate Keaper.xml

 

  Ocultar conteúdo

 

 


<?xml version="1.0" encoding="UTF-8"?>
<npc name="Gate Keaper" script="travel.lua" walkinterval="0">
    <health now="100" max="100"/>
    <look type="466"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Digite o nome do local que deseja se teletransportar: {Earth}, {Sand City}, {M2}, {Tsufur}, {Zelta}, {Vegeta}, {Namek}, {Lude}, {Premia}, {Boar's Island}, {Ruudo}, {City 17}, {Gardia}."/>
    </parameters>
</npc>
 

 

 

 

travel.lua

 

 

  Ocultar conteúdo

 

 


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'earth'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Earth}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, destination = {x=106, y=149, z=10} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
local travelNode = keywordHandler:addKeyword({'sand city'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Sand City}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, destination = {x=288, y=935, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Posso te teletransportar para: {Earth}, {Sand City}, {M2}, {Tsufur}, {Zelta}, {Vegeta}, {Namek}, {Lude}, {Premia}, {Boar's Island}, {Ruudo}, {City 17} e {Gardia}."})

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'m2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {M2}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=78, y=514, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'tsufur'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Tsufur}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=105, y=489, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'zelta'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Zelta}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=105, y=515, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'vegeta'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Vegeta}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=141, y=489, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'namek'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Namek}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=141, y=515, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'lude'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Lude}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=191, y=498, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'premia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente se teletransportar para {Premia}?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=191, y=524, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"boar's island"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {Boar's Island}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=75, y=488, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"ruudo"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {Ruudo}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=103, y=547, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"city 17"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {City 17}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=800, y=1133, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})
    
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({"gardia"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Voce quer realmente se teletransportar para {Gardia}?"})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, destination = {x=48, y=1274, z=8} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tudo bem, até mais!'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
 

 

 

 

so editar !

 

se quiser faço em  talkactions !

nao é o script que eu pedi.

3 horas atrás, Rusherzin disse:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Walker" script="walkernpc.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100" />
	<look type="140" head="77" body="81" legs="79" feet="95" addons="0" />
</npc>

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)			npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)		npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)		npcHandler:onCreatureSay(cid, type, msg)		end

local lastSound = 0
function onThink()
	if lastSound < os.time() then
		lastSound = (os.time() + 6)
		selfSay("MENSAGEM")
	end
	npcHandler:onThink()
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

tem como botar 1 effeito ao teleportar?

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites

Configurou a tabela de forma errada. E sim, botei efeito, só mudar na variável:
 

local posToBe = {x=1001, y=904, z=7}
local effect  = 45
local posToGo = {
		["konoha"] = {x=894, y=831, z=7},
		["south florest"] = {x=911, y=1179, z=7},
		["suna"] = {x=563, y=1144, z=7},
		["south island"] = {x=1086, y=1397, z=7},
		["ilhazinha"] = {x=1100, y=1531, z=7},
		["mist"] = {x=1145, y=1218, z=7},
		["south desert"] = {x=1495, y=1052, z=7}
		}

function onSay(cid, words, param)
	local playerpos = getCreaturePosition(cid)

	if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then
		return 
	end

	if(posToGo[string.lower(words)]) then
		doTeleportThing(cid, posToGo[string.lower(words)], true)
		doSendMagicEffect(getCreaturePosition(cid), effect)
	end

end

 

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo