Ir para conteúdo

Featured Replies

Postado
[Error - NpcScript Interface] 
[0:45:50.550] data/npc/scripts/athan.lua:onThink
[0:45:50.550] Description: 
[0:45:50.550] data/npc/scripts/athan.lua:177: attempt to compare number with nil
[0:45:50.550] stack traceback:[0:45:50.550]   data/npc/scripts/athan.lua:177: in function <data/npc/scripts/athan.lua:166>
 
[0:45:51.064] [Error - NpcScript Interface] 
[0:45:51.064] data/npc/scripts/athan.lua:onThink
[0:45:51.064] Description: 
[0:45:51.064] data/npc/scripts/athan.lua:177: attempt to compare number with nil
[0:45:51.064] stack traceback:[0:45:51.064]   data/npc/scripts/athan.lua
 
 
meu npc apresenta esse erro no console, alguém pode da uma olhada aew?
 
 
script dele 
 

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.', cid)
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('Ola ' .. getCreatureName(cid) .. '! Eu vendo {parcel}, {letter} e {ticket city}!', cid)
focus = cid
talk_start = os.clock()

elseif msgcontains(msg, 'ticket artemisias') or msgcontains(msg, 'ticket a') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Artemisias?', cid)
talk_state = 1
talk_start = os.clock()
elseif talk_state == 1 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,170,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Artemisias.")
doItemSetAttribute(item1,"name","Artemisias Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket nissea') or msgcontains(msg, 'ticket n') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Nissea?', cid)
talk_state = 2
talk_start = os.clock()
elseif talk_state == 2 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,171,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Nissea.")
doItemSetAttribute(item1,"name","Nissea Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket valentia') or msgcontains(msg, 'ticket k') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Valentia?', cid)
talk_state = 3
talk_start = os.clock()
elseif talk_state == 3 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,172,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Valentia.")
doItemSetAttribute(item1,"name","Valentia Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket horpus') or msgcontains(msg, 'ticket h') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Horpus?', cid)
talk_state = 4
talk_start = os.clock()
elseif talk_state == 4 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,173,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Horpus.")
doItemSetAttribute(item1,"name","Horpus Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket egeu') or msgcontains(msg, 'ticket e') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Egeu?', cid)
talk_state = 5
talk_start = os.clock()
elseif talk_state == 5 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,174,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Egeu.")
doItemSetAttribute(item1,"name","Egeu Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket styge') or msgcontains(msg, 'ticket s') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Styge?', cid)
talk_state = 6
talk_start = os.clock()
elseif talk_state == 6 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,175,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Styge.")
doItemSetAttribute(item1,"name","Styge Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket kypros') or msgcontains(msg, 'ticket s') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Kypros?', cid)
talk_state = 8
talk_start = os.clock()
elseif talk_state == 8 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,176,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Kypros.")
doItemSetAttribute(item1,"name","Kypros Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'parcel') or msgcontains(msg, 'parc') then
selfSay('Voce tem os 10 gold coin para comprar 1 parcel?', cid)
talk_state = 7
talk_start = os.clock()
elseif talk_state == 7 and msgcontains(msg, 'yes') then

if doPlayerRemoveMoney(cid, 10) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,2595,1)
local item2 = doPlayerAddItem(cid,2599,1)
doItemSetAttribute(item1,"description","Este parcel foi obtido por "..getCreatureName(cid)..".")
doItemSetAttribute(item1,"name","")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end

elseif msgcontains(msg, 'ticket city') or msgcontains(msg, 'cit') then
selfSay('Eu vendo {ticket artemisias}, {ticket egeu} , {ticket nissea} , {ticket horpus} , {ticket styge} e {ticket valentia} para você poder viajar pelo nosso continente.', cid)

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Bye ' .. getCreatureName(cid) .. ', Come back.', cid)
focus = 0
talk_start = 0
elseif msgcontains(msg, 'me xupa') then
selfSay('What?', cid)
talk_state = 0
end
end

function onCreatureChangeOutfit(creature)end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next...', cid)
end
focus = 0
talk_start = 0
end

if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good Bye', cid)
focus = 0
talk_start = 0
end
end
end

Assinatura retirada pela direção!

Postado

 
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.', cid)
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('Ola ' .. getCreatureName(cid) .. '! Eu vendo {parcel}, {letter} e {ticket city}!', cid)
focus = cid
talk_start = os.clock()
 
elseif msgcontains(msg, 'ticket artemisias') or msgcontains(msg, 'ticket a') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Artemisias?', cid)
talk_state = 1
talk_start = os.clock()
elseif talk_state == 1 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,170,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Artemisias.")
doItemSetAttribute(item1,"name","Artemisias Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket nissea') or msgcontains(msg, 'ticket n') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Nissea?', cid)
talk_state = 2
talk_start = os.clock()
elseif talk_state == 2 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,171,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Nissea.")
doItemSetAttribute(item1,"name","Nissea Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket valentia') or msgcontains(msg, 'ticket k') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Valentia?', cid)
talk_state = 3
talk_start = os.clock()
elseif talk_state == 3 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,172,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Valentia.")
doItemSetAttribute(item1,"name","Valentia Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket horpus') or msgcontains(msg, 'ticket h') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Horpus?', cid)
talk_state = 4
talk_start = os.clock()
elseif talk_state == 4 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,173,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Horpus.")
doItemSetAttribute(item1,"name","Horpus Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket egeu') or msgcontains(msg, 'ticket e') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Egeu?', cid)
talk_state = 5
talk_start = os.clock()
elseif talk_state == 5 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,174,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Egeu.")
doItemSetAttribute(item1,"name","Egeu Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket styge') or msgcontains(msg, 'ticket s') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Styge?', cid)
talk_state = 6
talk_start = os.clock()
elseif talk_state == 6 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,175,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Styge.")
doItemSetAttribute(item1,"name","Styge Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket kypros') or msgcontains(msg, 'ticket s') then
selfSay('Voce tem os 1000 gold coin para comprar 1 ticket of Kypros?', cid)
talk_state = 8
talk_start = os.clock()
elseif talk_state == 8 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 1000) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,176,1)
doItemSetAttribute(item1,"text","[pbOT Air Ticket]: Passaport\nDestination: Kypros.")
doItemSetAttribute(item1,"name","Kypros Passaport")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'parcel') or msgcontains(msg, 'parc') then
selfSay('Voce tem os 10 gold coin para comprar 1 parcel?', cid)
talk_state = 7
talk_start = os.clock()
elseif talk_state == 7 and msgcontains(msg, 'yes') then
 
if doPlayerRemoveMoney(cid, 10) == TRUE then
selfSay('Parabens! Voce adquiriu um item!', cid)
local item1 = doPlayerAddItem(cid,2595,1)
local item2 = doPlayerAddItem(cid,2599,1)
doItemSetAttribute(item1,"description","Este parcel foi obtido por "..getCreatureName(cid)..".")
doItemSetAttribute(item1,"name","")
else
selfSay('Desculpe, voce nao tem dinheiro suficiente!', cid)
end
 
elseif msgcontains(msg, 'ticket city') or msgcontains(msg, 'cit') then
selfSay('Eu vendo {ticket artemisias}, {ticket egeu} , {ticket nissea} , {ticket horpus} , {ticket styge} e {ticket valentia} para você poder viajar pelo nosso continente.', cid)
 
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Bye ' .. getCreatureName(cid) .. ', Come back.', cid)
focus = 0
talk_start = 0
elseif msgcontains(msg, 'me xupa') then
selfSay('What?', cid)
talk_state = 0
end
end
 
function onCreatureChangeOutfit(creature)end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next...', cid)
end
focus = 0
talk_start = 0
end
 
if focus ~= 0 and isCreature(focus) then
if getDistanceToCreature(focus) > 5 then
selfSay('Good Bye', cid)
focus = 0
talk_start = 0
end
end
end
 

-"Supra Omnes Lux Lucis"

- Acima de todos brilha a Luz -

5VGnDyBz.png

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo