Postado Janeiro 11, 2018 7 anos me sale el mismo error debe ser algo con la funcion. [Error - Npc interface] data/npc/scripts/wosve/craff.lua Description: data/lib/050-function.lua:306: attempt to index a boolean value [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/craff.lua me podrian ayudar como agrego esa nueva funcion
Postado Janeiro 11, 2018 7 anos @Garou tipo assim? Citar local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local npcTopic, xmsg = {}, {} 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 local craft = { ["demon helmet"] = {reward = {{2493, 1}}, items = {{id = 2160, count = 1}, {id = 2148, count = 1}}}, ["magic plate armor"] = {reward = {{2472, 1}}, items = {{id = 2160, count = 10}, {id = 2044, count = 2}}}, ["soft boots"] = {reward = {{6132, 1}}, items = {{id = 2160, count = 1}, {id = 2148, count = 1}}}, ["knight armor"] = {reward = {{2376, 1}}, items = {{id = 2160, count = 1}, {id = 2148, count = 1}}} } local function checkItemsNeeded(cid, items) local check = {} for i, v in pairs(items) do if getPlayerItemCount(cid, v.id) >= v.count then check[#check + 1] = 1 end end return #check end local function getItemsFromTable(items) local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items.count .. ' ' .. getItemNameById(items.id) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end local function craftingEffects(position, delay) local text = {"Ishhh!", "Kaboom", "Tic Tac", "BUM!", "Blop Blop!", "Cronch!"} local effects = {2, 6, 25, 31, 36,40, 54, 51, 65, 66, 67, 68} if delay ~= 0 then doSendAnimatedText(position, text[math.random(1, #text)], math.random(1, 255)) doSendMagicEffect(position, effects[math.random(1, #effects)]) addEvent(craftingEffects, 1000, position, delay - 1) end end function creatureSayCallback(cid, type, msg) local talkUser, msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, string.lower(msg) if(not npcHandler:isFocused(cid)) then if isInArray({"hi", "hello"}, msg) then npcHandler:addFocus(cid) npcHandler:say("Ola, "..getPlayerName(cid)..". Posso Construir Alguns {items} Para Voce, Mas Preciso De Linceças Especiais Para Faze Los.", cid) npcTopic[talkUser] = 1 else return false end elseif msgcontains(msg, "items") and npcTopic[talkUser] == 1 then local text = "" for i, v in pairs(craft) do text = text .. " {"..i.."}, " end npcHandler:say("Eu Posso Contruir " .. text .. " Qual Deles Voce Deseja?", cid) npcTopic[talkUser] = 2 elseif craft[msg] and npcTopic[talkUser] == 2 then npcHandler:say("Oh, " .. msg .. " E Uma Boa Escolha. Deixe Me Ver ... Eu Preciso " .. getItemsFromTable(craft[msg].items) .. ", Voce As Tem?" , cid) npcTopic[talkUser] = 3 xmsg[talkUser] = msg elseif not craft[msg] and npcTopic[talkUser] == 2 then npcHandler:say("Eu Nao Estou Elaborando Esse Item, Talvez Eu Possa Considerar Seu Pedido Mais Tarde.", cid) npcTopic[talkUser] = 0 elseif msgcontains(msg, "yes") and npcTopic[talkUser] == 3 then local x = craft[xmsg[talkUser]] local delay = 6 if checkItemsNeeded(cid, x.items) == #x.items then craftingEffects(getCreaturePosition(getNpcCid()), delay) for i = 1, #x.items do doPlayerRemoveItem(cid, x.items.id, x.items.count) end addEvent(function() if isPlayer(cid) then for i = 1, #x.reward do doPlayerAddItem(cid, x.reward[1], x.reward[2]) end end end, delay*1000) local type = talkUser == 0 and TALKTYPE_SAY or TALKTYPE_PRIVATE_NP addEvent(doCreatureSay, delay*1000, getNpcCid(), "Muito Obrigado! Aqui Esta O Seu Item Como Eu Prometi.", type, cid) npcTopic[talkUser] = 0 else npcHandler:say("Desculpe, Mas Voce Nao Tem Os Itens Que Eu Preciso.", cid) npcTopic[talkUser] = 0 end elseif msgcontains(msg, "no") and npcTopic[talkUser] == 3 then npcHandler:say("Ok, maybe on the next.", cid) npcTopic[talkUser] = 0 elseif msgcontains(msg, "bye") then npcHandler:say("Bye.", cid) npcHandler:releaseFocus(cid) else npcHandler:say("Estou Muito Ocupado, Nao Posso Falar Com voce Agora!", cid) npcTopic[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) Projeto Nto Myth " Eu to disposto a lutar e que se foda todo mundo que duvida que eu vou tocar o terror na porra toda! "
Postado Janeiro 12, 2018 7 anos @Hokograma oye amigo hablo con el y no me da el items que le pido acambio x los 2 que tengo en el bag no dice nada o explicame como funciona, este si lo pude crear con el god items reward: 5898, 1 - items craff1: 5848,1 - items craff2: 5878, 1 los items craff1 y craff2: son los que dare para que me haga el items reward. me urge algo asi.. plx Error que me da cuando digo. shoton symbol, id items 5898... [12/01/2018 07:36:26] [Error - Npc interface] [12/01/2018 07:36:26] data/npc/scripts/wosve/Raiton Master.lua:onCreatureSay [12/01/2018 07:36:26] Description: [12/01/2018 07:36:26] data/lib/050-function.lua:294: attempt to index a boolean value [12/01/2018 07:36:26] stack traceback: [12/01/2018 07:36:26] data/lib/050-function.lua:294: in function 'getItemNameById' [12/01/2018 07:36:26] data/npc/scripts/Raiton Master.lua:31: in function 'getItemsFromTable' [12/01/2018 07:36:26] data/npc/scripts/Raiton Master.lua:64: in function 'callback' [12/01/2018 07:36:26] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay' [12/01/2018 07:36:26] data/npc/scripts/Raiton Master.lua:7: in function <data/npc/scripts/Raiton Master.lua:7> Editado Janeiro 12, 2018 7 anos por acan (veja o histórico de edições)
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.