Gente tou com meu ot 8.10 mais tem um problema no npc Timral e Nimral quando a pessoa fala hi ele nao respondee o escript ta tdo certinho me ajuda ai plz oia o script do Timral..
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if isPremium(cid) then
selfSay('Hello ' .. creatureGetName(cid) .. '! I can take you to the Outlaws Boat for 50 real.')
focus = cid
talk_start = os.clock()
else
selfSay('Soh premium viaja, seu pobre!!.')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'outlaws boat') then
selfSay('Are you sure you want to go to Outlaws Boat?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,50) then
travel(cid, 1447, 1517, 6)
selfSay('Vai porra!!')
else
selfSay('Sorry, you don\'t have enough money.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Vai timbora fi da peste, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Acabou o tempo infiliz...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Xau Xau!!.')
focus = 0
end
end
end
ME AJUDEM POR FAVOR, IA FICAR MUITO FELIZ XD
Oii acho q isso aqui pode resolver o caso do seu Timral tente colocar isso aqui no seu Timral.xml que fica na pasta npc
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Timral" script="data/npc/scripts/default.lua" walkinterval="0" floorchange="0">
<health now="150" max="150"/>
<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. If you don't know where to flow, say {travel}."/>
<parameter key="travel_destinations" value="[color="#FF0000"]rhyves[/color],[color="#0000FF"]159[/color],[color="#FF8C00"]338[/color],[color="#2E8B57"]6[/color],[color="#FF00FF"]50[/color];[color="#FF0000"]jorvik[/color],[color="#0000FF"]420[/color],[color="#FF8C00"]256[/color],[color="#2E8B57"]6[/color],[color="#FF00FF"]50[/color];"/>
</parameters>
</npc>
agora se ligue onde ta em vermelho é o nome do lugar
onde ta em azul escuro é o local x da posição que o player irá
onde ta em laranja é o local y da posição que o player irá
onde ta em verde é o local z da posição que o player irá
e onde ta em rosa é o preço que custa para ir para esse lugar!
e o que ta do lado começando com "jorvik" eh a msm coisa do outro "jorvik" é o nome do lugar... e ai vai ;]
Espero ter ajudado ^^
ahh o default.lua eh esse oh:
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 function onThink() npcHandler:onThink() end npcHandler:addModule(FocusModule:new())
ai eh so vc fazer lá o default.lua que fica na pasta do seu OT em Data/npc/scripts e colocar isso lá caso não tenho o default.lua você copia um arquivo qualquer que tenha lá e cola lá e renomeia para default, abre esse arquivo apaga tudo dentro e cola isso que postei aqui pra vc! pronto salva o arquivo e reiniciar o server e fala com npc ;]!
Espero ter ajudado!





info
Grupo: Campones
Registrado: 25/06/08
Posts: 2
Reputação: 0
Gente tou com meu ot 8.10 mais tem um problema no npc Timral e Nimral quando a pessoa fala hi ele nao responde
e o escript ta tdo certinho me ajuda ai plz oia o script do Timral..
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if isPremium(cid) then
selfSay('Hello ' .. creatureGetName(cid) .. '! I can take you to the Outlaws Boat for 50 real.')
focus = cid
talk_start = os.clock()
else
selfSay('Soh premium viaja, seu pobre!!.')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'outlaws boat') then
selfSay('Are you sure you want to go to Outlaws Boat?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,50) then
travel(cid, 1447, 1517, 6)
selfSay('Vai porra!!')
else
selfSay('Sorry, you don\'t have enough money.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Vai timbora fi da peste, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Acabou o tempo infiliz...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Xau Xau!!.')
focus = 0
end
end
end
ME AJUDEM POR FAVOR, IA FICAR MUITO FELIZ XD