Npc Bugando

fabioluciopda
em Lixeira Pública

fabioluciopda

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/05/09Posts: 6Char no Tibia: Frozen Roox

Eu Criei 1 NPC Chamado Anunciante Para Mandar Broadcast Para o OT Todo e Quando Eu Abro o OT Aparece Assim:

[29/10/2010 18:54:51] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/broadcaster.lua
[29/10/2010 18:54:51] data/npc/scripts/broadcaster.lua:115: ')' expected near 'Disse'

 

Se Alguem Puder Me Ajuda , Esse e o Script

 

-- NPC Broadcaster by Alreth, v1.40, 2008-09-22 17:50 CET
-- Idea by souhlen (Anel)
-- Thanks to Qwerty| for helping fix the spambug
-- Thanks to Colandus for providing changes for compability with Tibia 8.21/22.

focus = 0
next_focus = 0
talk_start = 0
msgHi = 'Ola! Voce Deseja Mandar Uma Mensagem Para o Tibia Lost?'
msgBye = 'Espero Te Ver Novamente!'
price = 5000
inConvo = 0
broadcast = ''
cast = ''
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(msgBye)
       distFocus = getDistanceToCreature(next_focus)
       if (distFocus ~= nil and distFocus < 4) then
           selfSay(msgHi)
           talk_start = os.clock()
           focus = next_focus
           next_focus = 0
           inConvo = 1
       else
           focus = 0
           talk_start = 0
           inConvo = 0
       end
    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 onCreature(cid, type, msg)
   msg2 = msg
   msg = string.lower(msg)
   if (cast ~= '') then
       selfSay('does nothing')
   -- do nothing, wait until message has been broadcasted and npc has replied
   elseif (getDistanceToCreature(cid) >= 4 and focus == cid) then
       selfSay('Chegue Mais Perto, '..getCreatureName(cid)..'. Eu Nao Consigo Ouvir O Que Voce Diz.')

   elseif (type == 1) then
        if ((string.find(msg, '(%a*)hi(%a*)') or string.find(msg, '(%a*)hello(%a*)') or string.find(msg, '(%a*)heylo(%a*)') or string.find(msg, '(%a*)greetings(%a*)')) and (focus == 0) and getDistanceToCreature(cid) < 4) then
           selfSay(msgHi)
           focus = cid
           talk_start = os.clock()
           inConvo = 1

       elseif ((string.find(msg, '(%a*)hi(%a*)') or string.find(msg, '(%a*)hello(%a*)') or string.find(msg, '(%a*)heylo(%a*)') or string.find(msg, '(%a*)greetings(%a*)')) and (focus ~= cid) and getDistanceToCreature(cid) < 4)  then
            if (next_focus > 0 and getDistanceToCreature(next_focus) < 4) then
                selfSay('Tire Uma Soneca Enquanto Eu Ajudo Os Outros, ' .. getCreatureName(cid) .. '.')
            else
                selfSay('Espero Ver Voce em Breve, ' .. getCreatureName(cid) .. '.')
                next_focus = cid
            end

        elseif (focus == cid) then
           talk_start = os.clock()

           if ((msgcontains(msg, 'mensagem') or msgcontains(msg, 'enviar')) and inConvo == 0) then
               if (getPlayerLevel(cid) >= 30) then
                   selfSay('Voce Quer Que Eu Transmita Algo Para Voce?')
                   inConvo = 1
               else
                   selfSay('Volte Aqui Quando Voce Estiver Em Um LvL Mais Alto')
               end

           elseif (msgcontains(msg, 'sim') and inConvo == 1) then
               selfSay('Me Diga O Que Deseja Transmitir.')
               inConvo = 2

           elseif (msgcontains(msg, 'nao') and inConvo == 1) then
               selfSay('Perhaps tomorrow then..')
               if (next_focus > 0 and getDistanceToCreature(next_focus) < 4) then
                   selfSay(msgHi)
                   talk_start = os.clock()
                   focus = next_focus
                   next_focus = 0
                   inConvo = 1
               else
                   focus = 0
                   talk_start = 0
                   inConvo = 0
               end
               broadcast = ''

           elseif (inConvo == 2 and (msg ~= 'parar')) then
               if (string.len(msg) > 90) then
                   selfSay('Sinto Muito Mas Sua Mensagem Nao Pode Ter Mais de 90 Letras, Incluindo Espaco e Outros Caracteres. Diga "mensagem" ou Diga "parar" Para Terminar Nossa Conversa.')
               else
                   broadcast = msg2
                   selfSay('Voce Quer Pagar '..price..' gold Para Eu Mandar Esta Mensagem? "'..broadcast..'"')
                   inConvo = 3
               end

           elseif (msgcontains(msg, 'sim') and inConvo == 3) then
               if (doPlayerRemoveMoney(cid, price) == 1) then
                   doSendBroadcast ("..getCreatureName(cid).." Disse: "..broadcast..")
                   saycast = os.clock()
                   inConvo = 1

                   io.output(io.open("broadcast.log", "a"))
                   io.write("["..os.date("%y.%m.%d %X").."] <"..getCreatureName(cid).."> "..broadcast.."\n")
                   io.close()
                   cast = broadcast
               else
                   selfSay('Voce Nao Pode Usar Este Servico. Por Favor Volte Quando Tiver Mais Dinheiro!')
                   if (next_focus > 0) then
                       distFocus = getDistanceToCreature(next_focus)
                       if (distFocus ~= nil and distFocus < 4) then
                           selfSay(msgHi)
                           talk_start = os.clock()
                           focus = next_focus
                           next_focus = 0
                           inConvo = 1
                       else
                           focus = 0
                           talk_start = 0
                           inConvo = 0
                       end
                       broadcast = ''
                   end
               end

           elseif (msgcontains(msg, 'nao') and inConvo == 3) then
               selfSay('Ok then.')
               inConvo = 0
               broadcast = ''

           elseif (string.find(msg, '(%a*)trabalho(%a*)')) then
               selfSay('Eu Tenho a Maior Voz do Mundo! Pessoas Me Pagam Para Enviar Mensagens Para Elas.')
               inConvo = 0

            elseif (string.find(msg, '(%a*)bye(%a*)')) then
               selfSay(msgBye)
               if (next_focus > 0) then
                   distFocus = getDistanceToCreature(next_focus)
                   if (distFocus ~= nil and distFocus < 4) then
                       selfSay(msgHi)
                       talk_start = os.clock()
                       focus = next_focus
                       next_focus = 0
                       inConvo = 1
                   else
                       focus = 0
                       talk_start = 0
                       inConvo = 0
                   end
                   broadcast = ''
                end
            end
        end
    end
end


function onCreatureChangeOutfit(creature)
end

function onThink()
   if (cast ~= '' and (os.clock() - saycast) > 1) then
       selfSay('Voce Quer Que Eu Transmita Algo Para Voce?')
       cast = ''
   elseif (os.clock() - talk_start) > 30 then
       if (focus > 0) then    
           selfSay(msgBye)
           if (next_focus > 0) then
               distFocus = getDistanceToCreature(next_focus)
               if (distFocus ~= nil and distFocus < 4) then
                   selfSay(msgHi)
                   talk_start = os.clock()
                   focus = next_focus
                   next_focus = 0
                   inConvo = 1
               else
                   focus = 0
                   talk_start = 0
                   inConvo = 0
               end
           else
               focus = 0
               talk_start = 0
               inConvo = 0
           end
           broadcast = ''
       end
    elseif (focus ~= 0) then
        distFocus = getDistanceToCreature(focus)
       if (distFocus ~= nil and distFocus > 5) then
           selfSay(msgBye)
           if (next_focus > 0) then
               distFocus = getDistanceToCreature(next_focus)
               if (distFocus ~= nil and distFocus < 4) then
                   selfSay(msgHi)
                   talk_start = os.clock()
                   focus = next_focus
                   next_focus = 0
                   inConvo = 1
               end
           else
               focus = 0
               talk_start = 0
               inConvo = 0
           end
           broadcast = ''
       end
   end
end
end

 

Vlws Ai

Karislayer

♦ Retired ♦
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 31/07/10Posts: 247

Caro amigo, por favor olhe antes de criar um post, essa é a área de Design, e o que você posta é um Pedido (ajuda de Script?

Atenção caro amigo, Abraços!!!

Reportado para que movam seu tópico!!!

Ajudando a comunidade no Anonimato!

comedinhasss

Comedinha
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 08/08/07Posts: 520Gênero: MasculinoChar no Tibia: Sir Morths

Reportado para moverem a área certa...

enquanto ao erro:

 

Tente colocar esse:

 

-- NPC Broadcaster by Alreth, v1.40, 2008-09-22 17:50 CET
-- Idea by souhlen (Anel)
-- Thanks to Qwerty| for helping fix the spambug
-- Thanks to Colandus for providing changes for compability with Tibia 8.21/22.

focus = 0
next_focus = 0
talk_start = 0
msgHi = 'Ola! Voce Deseja Mandar Uma Mensagem Para o Tibia Lost?'
msgBye = 'Espero Te Ver Novamente!'
price = 5000
inConvo = 0
broadcast = ''
cast = ''
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(msgBye)
   	distFocus = getDistanceToCreature(next_focus)
   	if (distFocus ~= nil and distFocus < 4) then
       	selfSay(msgHi)
       	talk_start = os.clock()
       	focus = next_focus
       	next_focus = 0
       	inConvo = 1
   	else
       	focus = 0
       	talk_start = 0
       	inConvo = 0
   	end
	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 onCreature(cid, type, msg)
msg2 = msg
msg = string.lower(msg)
if (cast ~= '') then
   	selfSay('does nothing')
-- do nothing, wait until message has been broadcasted and npc has replied
elseif (getDistanceToCreature(cid) >= 4 and focus == cid) then
   	selfSay('Chegue Mais Perto, '..getCreatureName(cid)..'. Eu Nao Consigo Ouvir O Que Voce Diz.')

elseif (type == 1) then
    	if ((string.find(msg, '(%a*)hi(%a*)') or string.find(msg, '(%a*)hello(%a*)') or string.find(msg, '(%a*)heylo(%a*)') or string.find(msg, '(%a*)greetings(%a*)')) and (focus == 0) and getDistanceToCreature(cid) < 4) then
       	selfSay(msgHi)
       	focus = cid
       	talk_start = os.clock()
       	inConvo = 1

   	elseif ((string.find(msg, '(%a*)hi(%a*)') or string.find(msg, '(%a*)hello(%a*)') or string.find(msg, '(%a*)heylo(%a*)') or string.find(msg, '(%a*)greetings(%a*)')) and (focus ~= cid) and getDistanceToCreature(cid) < 4)  then
        	if (next_focus > 0 and getDistanceToCreature(next_focus) < 4) then
            	selfSay('Tire Uma Soneca Enquanto Eu Ajudo Os Outros, ' .. getCreatureName(cid) .. '.')
        	else
            	selfSay('Espero Ver Voce em Breve, ' .. getCreatureName(cid) .. '.')
            	next_focus = cid
        	end

    	elseif (focus == cid) then
       	talk_start = os.clock()

       	if ((msgcontains(msg, 'mensagem') or msgcontains(msg, 'enviar')) and inConvo == 0) then
           	if (getPlayerLevel(cid) >= 30) then
               	selfSay('Voce Quer Que Eu Transmita Algo Para Voce?')
               	inConvo = 1
           	else
               	selfSay('Volte Aqui Quando Voce Estiver Em Um LvL Mais Alto')
           	end

       	elseif (msgcontains(msg, 'sim') and inConvo == 1) then
           	selfSay('Me Diga O Que Deseja Transmitir.')
           	inConvo = 2

       	elseif (msgcontains(msg, 'nao') and inConvo == 1) then
           	selfSay('Perhaps tomorrow then..')
           	if (next_focus > 0 and getDistanceToCreature(next_focus) < 4) then
               	selfSay(msgHi)
               	talk_start = os.clock()
               	focus = next_focus
               	next_focus = 0
               	inConvo = 1
           	else
               	focus = 0
               	talk_start = 0
               	inConvo = 0
           	end
           	broadcast = ''

       	elseif (inConvo == 2 and (msg ~= 'parar')) then
           	if (string.len(msg) > 90) then
               	selfSay('Sinto Muito Mas Sua Mensagem Nao Pode Ter Mais de 90 Letras, Incluindo Espaco e Outros Caracteres. Diga "mensagem" ou Diga "parar" Para Terminar Nossa Conversa.')
           	else
               	broadcast = msg2
               	selfSay('Voce Quer Pagar '..price..' gold Para Eu Mandar Esta Mensagem? "'..broadcast..'"')
               	inConvo = 3
           	end

       	elseif (msgcontains(msg, 'sim') and inConvo == 3) then
           	if (doPlayerRemoveMoney(cid, price) == 1) then
               	selfSay('"..getCreatureName(cid).." Disse: "..broadcast.."')
               	saycast = os.clock()
               	inConvo = 1

               	io.output(io.open("broadcast.log", "a"))
               	io.write("["..os.date("%y.%m.%d %X").."] <"..getCreatureName(cid).."> "..broadcast.."\n")
               	io.close()
               	cast = broadcast
           	else
               	selfSay('Voce Nao Pode Usar Este Servico. Por Favor Volte Quando Tiver Mais Dinheiro!')
               	if (next_focus > 0) then
                   	distFocus = getDistanceToCreature(next_focus)
                   	if (distFocus ~= nil and distFocus < 4) then
                       	selfSay(msgHi)
                       	talk_start = os.clock()
                       	focus = next_focus
                       	next_focus = 0
                       	inConvo = 1
                   	else
                       	focus = 0
                       	talk_start = 0
                       	inConvo = 0
                   	end
                   	broadcast = ''
               	end
           	end

       	elseif (msgcontains(msg, 'nao') and inConvo == 3) then
           	selfSay('Ok then.')
           	inConvo = 0
           	broadcast = ''

       	elseif (string.find(msg, '(%a*)trabalho(%a*)')) then
           	selfSay('Eu Tenho a Maior Voz do Mundo! Pessoas Me Pagam Para Enviar Mensagens Para Elas.')
           	inConvo = 0

        	elseif (string.find(msg, '(%a*)bye(%a*)')) then
           	selfSay(msgBye)
           	if (next_focus > 0) then
               	distFocus = getDistanceToCreature(next_focus)
               	if (distFocus ~= nil and distFocus < 4) then
                   	selfSay(msgHi)
                   	talk_start = os.clock()
                   	focus = next_focus
                   	next_focus = 0
                   	inConvo = 1
               	else
                   	focus = 0
                   	talk_start = 0
                   	inConvo = 0
               	end
               	broadcast = ''
            	end
        	end
    	end
	end
end


function onCreatureChangeOutfit(creature)
end

function onThink()
if (cast ~= '' and (os.clock() - saycast) > 1) then
   	selfSay('Voce Quer Que Eu Transmita Algo Para Voce?')
   	cast = ''
elseif (os.clock() - talk_start) > 30 then
   	if (focus > 0) then	
       	selfSay(msgBye)
       	if (next_focus > 0) then
           	distFocus = getDistanceToCreature(next_focus)
           	if (distFocus ~= nil and distFocus < 4) then
               	selfSay(msgHi)
               	talk_start = os.clock()
               	focus = next_focus
               	next_focus = 0
               	inConvo = 1
           	else
               	focus = 0
               	talk_start = 0
               	inConvo = 0
           	end
       	else
           	focus = 0
           	talk_start = 0
           	inConvo = 0
       	end
       	broadcast = ''
   	end
	elseif (focus ~= 0) then
    	distFocus = getDistanceToCreature(focus)
   	if (distFocus ~= nil and distFocus > 5) then
       	selfSay(msgBye)
       	if (next_focus > 0) then
           	distFocus = getDistanceToCreature(next_focus)
           	if (distFocus ~= nil and distFocus < 4) then
               	selfSay(msgHi)
               	talk_start = os.clock()
               	focus = next_focus
               	next_focus = 0
               	inConvo = 1
           	end
       	else
           	focus = 0
           	talk_start = 0
           	inConvo = 0
       	end
       	broadcast = ''
   	end
end
end
end

Bruno de Carvalho Câmara
[email protected]<script data-cfhash='f9e31' type="text/javascript"> /* */</script> / (18) 9 9640-4544
 

 

 

 

 

 

 

 

 

 

facebook.png&key=5c75f89868a8711c49cc20315645ab5fd3ef2d384bf666dd888f1c280a6b75ed&resource=1 twitter.png&key=a62b8fde99e302436f4cc04056c02768d777c0d27d77011e8931ced8099246e6&resource=1 googleplus.png&key=f287787442661f4422363039ba86e9c578c4921ad397c8f0d88f31709d26c48a&resource=1 youtube.png&key=08e8d5ba725e0a7bfedfe6c9d413ff55e2febb19493974e3a1fd5160d3cabc9f&resource=1 skype.png&key=0aee9c9483d4f4dee341915e654aa361f40598341a31a62afec9f83a2734e0ad&resource=1 steam-icon.png&key=b869d73d6be3b894b7204e151a9582d3b2a84a5d853d940297fec82e1ae25b55&resource=1

 

 

 

 

 

 

 

 

 

 

btn_donateCC_LG.gif&key=ea1b6265cec82d379c00914ab97fd15478f9983200fa273984872388d20f0b62&resource=1 180x25-doar.gif&key=8671e0307e2a7fd446670d1b16671d35069b1c91bed3d028b8f7db698c59eac5&resource=1

 

"Pesadelos? Sonhos? Calma, é apenas eu pensando em você!"

 

wMwSJFE.png?1&key=101925b29f8396357ec8f63d177a708785a8da5f96f154f44e9a4c6599794673&resource=1

Zutun

Ex Coordenador de Design
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/06Posts: 513Gênero: MasculinoChar no Tibia: Under Detax

Obrigado por reportar comedinhass rep+.

Preste mais atenção ao fazer seus posts.

Tópico movido para Dúvida sobre Scripts.

Marcone S. Figueira

Entrada na Equipe de Design: 08/09/2010

Coordenação Design:18/11/2010



 

Saída:12/03/2011

Email: zutun@xtibia.com

fabioluciopda

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/05/09Posts: 6Char no Tibia: Frozen Roox

comedinhas eu fiz só que quando eu falo Hi ele não responde, num faz nada, só que aquele erro ja foi =D, se der pra ajudar vlw :)