Eu num intendo sobre mais vo procura a saber pra tentar te ajuda :smile_positivo:
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- Problema Com Script De Orlan (7.6)
info
Grupo: Campones
Registrado: 12/12/08
Posts: 2
Reputação: 0

nunca vi um script tão bugado! ![]()
não sei se vai dar certo, tive que fazer algumas gambiarras, tome e teste por você mesmo:
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
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
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('Lets go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 263 111 6')
focus = 0
talk_start = 0
else
selfSay('Sorry, you dont have enough money.')
end
elseif msgcontains(msg, 'mer jungle') then
if pay(cid,200) then
selfSay('Lets go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 253 227 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you dont have enough money.')
end
elseif msgcontains(msg, 'house city') then
if pay(cid,1000) then
selfSay('Lets go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 363 107 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you dont have enough money.')
end
elseif msgcontains(msg, 'lost city') then
if pay(cid,500) then
selfSay('Lets go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 477 35 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you dont have enough money.')
end
elseif msgcontains(msg, 'isengard') then
if pay(cid,1000) then
selfSay('Lets go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 728 212 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you dont have enough money.')
end
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
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
name='Eventide' date='11:17 - 18/12/2008 ' post='659183'nunca vi um script tão bugado!
não sei se vai dar certo, tive que fazer algumas gambiarras, tome e teste por você mesmo
Cara testei aki.. e deu esse erro no script:

Se puder me ajudar.. obrigado!
info
Grupo: Artesão
Registrado: 30/07/07
Posts: 101
Reputação: +1

Cara, ta horrível esse script, ta tudo errado...
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
A função acima, por exemplo, verifica a mensagem HI do player e se ele estiver a uma distancia maior de 4 sqm do NPC, o mesmo falará: "Sorry, only premium players can travel by boat.". ![]()
Mas arrumando seu script:
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('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()
if 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
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 3 then
selfSay('Come back later...')')
focus = 0
talk_start = 0
end
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
Se não funcionar poste a SS do erro.
info
Grupo: Conde
Registrado: 13/05/07
Posts: 778
Reputação: +14
Char no Tibia: Shea Fald

@Up o de cima está correto =)...
Tenta ai se der certo Reporte Como Dúvida Sanada =)
Abraços
//LorDz
Vlw ae lucasjockey ! testei aqui funcionou!
Obrigado galera! Duvida Sanada
ty =)
info
Grupo: Barão
Registrado: 19/03/07
Posts: 245
Reputação: +3

Dúvida Sanada!
Tópico Fechado!
Abraços,
Kardec.






info
Grupo: Campones
Registrado: 29/08/08
Posts: 0
Reputação: 0
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
Agora o arquivo da pasta npc:
...data/npc/fargum.xml
Finalmente, a tag da pasta world:
...data/world/npc.xml
Ta ae.. nao sei o motivo do erro! Espero que alguem possa me ajudar..
Desde de já, Obrigado pela atenção!
ty :positive: