Bom galera, estou com problemas no npc Orlan, o script dele esta correto, porém ao executar o server, ele nao responde aos players!
Ja tentei alterar o script e nada..
O script e esse aqui:
...data/npc/scripts/boat
focus = 0talk_start = 0
target = 0
following = false
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('Aye ' .. creatureGetName(cid) .. '! I can take you to the Mer Jungle (200 gps) the Samaransa Desert (150gps) House City (1000gps) Lost City (1500gps) Isengard (2500gps).')
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, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'samaransa desert') then
if pay(cid,150) then
selfSay('Set Sails!')
selfSay('/send ' .. creatureGetName(cid) .. ', 263 111 6')
focus = 0
talk_start = 0
else
selfSay('Trying to thieve me eh?!')
end
elseif msgcontains(msg, 'mer jungle') then
if pay(cid,200) then
selfSay('Set Sails!')
selfSay('/send ' .. creatureGetName(cid) .. ', 253 227 7')
focus = 0
talk_start = 0
else
selfSay('Trying to thieve me eh?!')
end
elseif msgcontains(msg, 'house city') then
if pay(cid,1000) then
selfSay('Set Sails!')
selfSay('/send ' .. creatureGetName(cid) .. ', 363 107 7')
focus = 0
talk_start = 0
else
selfSay('Trying to thieve me eh?!')
end
elseif msgcontains(msg, 'lost city') then
if pay(cid,1000) then
selfSay('Set Sails!')
selfSay('/send ' .. creatureGetName(cid) .. ', 477 35 7')
focus = 0
talk_start = 0
else
selfSay('Trying to thieve me eh?!')
end
elseif msgcontains(msg, 'isengard') then
if pay(cid,2500) then
selfSay('Set Sails!')
selfSay('/send ' .. creatureGetName(cid) .. ', 728 212 7')
focus = 0
talk_start = 0
else
selfSay('Trying to thieve me eh?!')
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Come back later, mate ' .. 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('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Eu acredito que o erro esteja na parte do if isPremium(cid), mais nao consegui arrumar!
Espero respostas.. Obrigado!
=)
PROTOCOLO 7.6