Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
<?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

  • Respostas 12
  • Visualizações 468
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 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

  • 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="

  • 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},

Postado
  • Autor
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


 

Postado

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

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo