Ir para conteúdo

Featured Replies

Postado

Segundo o erro no console, faltou finalizar uma função.

Tenta:

 

 

--//
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
 
 
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
msg = string.lower(msg)
--\\
 
   ----
local need = {
--item id....quantidade
{id = 2145, qt = 25},
}
local pokemon = "Moltres" -- nome do poke
   -----
--//
selfSay("olá, você gostaría de compra Algum Pokemon mega evoluido?!", cid)
talkState[talkUser] = 2
return true
 end
 
if msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
  if getPlayerItemCount(cid, need[1].id) < need[1].qt then
       selfSay("você não tem 25 Diamonds para compra um Pokemon mega evoluido!", cid)
  talkState[talkUser] = 0
          return true end
  if not addPokeToPlayer(cid, pokemon, 0, -1, "normal", true) then
       selfSay("voce está com 6 pokemons e não pode fazer a compra do mega Pokemon!", cid)
       talkState[talkUser] = 0
        return true end
        
         
for i = 1, #need do
doPlayerRemoveItem(cid, need[i].id, need[i].qt)
end

addPokeToPlayer(cid, pokemon, 0, 1, 'normal', true)
selfSay("nossa muito bom, obrigado e faça um bom proveito do seu novo pokémon!", cid)
talkState[talkUser] = 0

return true
end

 

 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


spacer.png

 

 

  • Respostas 23
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

Segundo o erro no console, faltou finalizar uma função.

Tenta:

 

 

--//
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
 
 
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
msg = string.lower(msg)
--\\
 
   ----
local need = {
--item id....quantidade
{id = 2145, qt = 25},
}
local pokemon = "Moltres" -- nome do poke
   -----
--//
selfSay("olá, você gostaría de compra Algum Pokemon mega evoluido?!", cid)
talkState[talkUser] = 2
return true
 end
 
if msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
  if getPlayerItemCount(cid, need[1].id) < need[1].qt then
       selfSay("você não tem 25 Diamonds para compra um Pokemon mega evoluido!", cid)
  talkState[talkUser] = 0
          return true end
  if not addPokeToPlayer(cid, pokemon, 0, -1, "normal", true) then
       selfSay("voce está com 6 pokemons e não pode fazer a compra do mega Pokemon!", cid)
       talkState[talkUser] = 0
        return true end
        
         
for i = 1, #need do
doPlayerRemoveItem(cid, need[i].id, need[i].qt)
end

addPokeToPlayer(cid, pokemon, 0, 1, 'normal', true)
selfSay("nossa muito bom, obrigado e faça um bom proveito do seu novo pokémon!", cid)
talkState[talkUser] = 0

return true
end

 

 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

erro

[23/08/2014 11:04:09] [Error - Npc interface]
[23/08/2014 11:04:09] data/npc/scripts/Lendarios.lua
[23/08/2014 11:04:09] Description:
[23/08/2014 11:04:09] data/npc/scripts/heal.lua:35: bad argument #1 to 'find' (string expected, got nil)
[23/08/2014 11:04:09] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Lendarios.lua

                                                            vps-plano-01.png

 

                                                                                                                    http://www.weblara.com.br/

Postado

Again.

 

--//
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

 
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
msg = string.lower(msg)
--\\
 
   ----
local need = {
--item id....quantidade
{id = 2145, qt = 25},
}
local pokemon = "Moltres" -- nome do poke
   -----
--//
selfSay("olá, você gostaría de comprar algum Pokemon mega evoluido?!", cid)
talkState[talkUser] = 2
return true
 end
if (msgcontains(msg, 'yes')) and talkState[talkUser] == 2 then
  if getPlayerItemCount(cid, need[1].id) < need[1].qt then
       selfSay("você não tem 25 Diamonds para compra um Pokemon mega evoluido!", cid)
  talkState[talkUser] = 0
          return true end
  if not addPokeToPlayer(cid, pokemon, 0, -1, "normal", true) then
       selfSay("voce está com 6 pokemons e não pode fazer a compra do mega Pokemon!", cid)
       talkState[talkUser] = 0
        return true end
         end
for i = 1, #need do
doPlayerRemoveItem(cid, need[i].id, need[i].qt)
addPokeToPlayer(cid, pokemon, 0, 1, 'normal', true)
selfSay("nossa muito bom, obrigado e faça um bom proveito do seu novo pokémon!", cid)
talkState[talkUser] = 0
 
return true
end
  
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


spacer.png

 

 

Postado
  • Autor

erro :(

[23/08/2014 12:00:31] [Error - Npc interface]
[23/08/2014 12:00:31] data/npc/scripts/Lendarios.lua
[23/08/2014 12:00:31] Description:
[23/08/2014 12:00:32] data/npc/scripts/heal.lua:35: bad argument #1 to 'find' (string expected, got nil)
[23/08/2014 12:00:32] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Lendarios.lua

Editado por SliceFalso (veja o histórico de edições)

                                                            vps-plano-01.png

 

                                                                                                                    http://www.weblara.com.br/

Postado

Tenta se nao der diga oque esse script faz assim podemos fazer outro.

--//
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
 
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
msg = string.lower(msg)
--\\
 
   ----
local need = {
--item id....quantidade
{id = 2145, qt = 25},
}
local pokemon = "Moltres" -- nome do poke
   -----
--//
selfSay("olá, você gostaría de compra Algum Pokemon mega evoluido?!", cid)
talkState[talkUser] = 2
return true
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
  if getPlayerItemCount(cid, need[1].id) < need[1].qt then
       selfSay("você não tem 25 Diamonds para compra um Pokemon mega evoluido!", cid)
  talkState[talkUser] = 0
          return true end
  if not addPokeToPlayer(cid, pokemon, 0, -1, "normal", true) then
       selfSay("voce está com 6 pokemons e não pode fazer a compra do mega Pokemon!", cid)
       talkState[talkUser] = 0
        return true end
for i = 1, #need do
doPlayerRemoveItem(cid, need[i].id, need[i].qt)
end
addPokeToPlayer(cid, pokemon, 0, 1, 'normal', true)
selfSay("nossa muito bom, obrigado e faça um bom proveito do seu novo pokémon!", cid)
talkState[talkUser] = 0
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Discord: Naze#3578

 

Ter Linux Dentro de Windows com Acesso 'localhost' para testes e +

AutoLoot Otimizado Direto na Source (tfs 0.4/otx)

 

// Pirataria é crime, original é roubo, compartilhar é legal.

 

tumblr_muk78tEwDQ1qah4nko1_500.gif

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