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