Estou tendo problemas com o npc Orlan (barco)
vou postar primero uma ss, dos erros que ocorrem quando tento iniciar o server:
Agora irei postar o script:
...data/nps/scripts/boat
following = falseattacking = 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
selfSay('Heloo' .. creatureGetName(cid) .. '! I can take you to the Mer Jungle (200 gps) the Samaransa Desert (150gps) House City (1000gps) Lost City (500gps) Isengard (1000gps).')
focus = cid
talk_start = os.clock()
else
selfSay('Sorry, only premium players can travel by boat.')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
elseif msgcontains(msg, 'samaransa desert') then
if pay(cid,150) then
selfSay('Let's go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 263 111 6')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don't have enough money.')
end
elseif msgcontains(msg, 'mer jungle') then
if pay(cid,200) then
selfSay('Let's go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 253 227 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don't have enough money.')
end
elseif msgcontains(msg, 'house city') then
if pay(cid,1000) then
selfSay('Let's go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 363 107 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don't have enough money.')
end
elseif msgcontains(msg, 'lost city') then
if pay(cid,500) then
selfSay('Let's go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 477 35 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don't have enough money.')
end
elseif msgcontains(msg, 'isengard') then
if pay(cid,1000) then
selfSay('Let's go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 728 212 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don't have enough money.')
end
if string.find(msg, '(%a*)yes(%a*)') and cid == focus and talkcount == 1 then
if shop == 1 then
buy(cid,item,count,price)
talk_start = os.clock()
end
if shop == 2 then
sell(cid,item,count,price)
talk_start = os.clock()
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Come back later...')')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Agora o arquivo da pasta npc:
...data/npc/fargum.xml
<?xml version="1.0"?><npc name="Fargum" script="data/npc/scripts/boat.lua" access="3">
<look type="134" head="114" body="114" legs="114" feet="114"/>
</npc>
Finalmente, a tag da pasta world:
...data/world/npc.xml
<npc name="Fargum" x="97" y="75" z="6" dir="3"/>
Ta ae.. nao sei o motivo do erro! Espero que alguem possa me ajudar..
Desde de já, Obrigado pela atenção!
ty :positive: