Postado Agosto 23, 2014 10 anos Segundo o erro no console, faltou finalizar uma função. Tenta: Mostrar conteúdo oculto --// 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())
Postado Agosto 23, 2014 10 anos Autor Em 23/08/2014 em 14:01, Nogard disse: Segundo o erro no console, faltou finalizar uma função. Tenta: Mostrar conteúdo oculto Mostrar conteúdo oculto --// 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
Postado Agosto 23, 2014 10 anos Again. Mostrar conteúdo oculto --// 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())
Postado Agosto 23, 2014 10 anos 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 Agosto 23, 2014 10 anos por SliceFalso (veja o histórico de edições)
Postado Agosto 23, 2014 10 anos Tenta se nao der diga oque esse script faz assim podemos fazer outro. Mostrar conteúdo oculto --// 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())
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.