Flaah 18 Postado Julho 26, 2012 Share Postado Julho 26, 2012 (editado) Boa Tarde amigos do XTIBIA, estou com um probleminha no meu NPC, ele fica dando o seguinte ERRO no console, quando diz: yes: [25/07/2012 22:39:55] [Error - Npc interface][25/07/2012 22:39:55] data/npc/scripts/Reborn.lua:onCreatureSay [25/07/2012 22:39:55] Description: [25/07/2012 22:39:55] data/npc/scripts/Reborn.lua:59: attempt to index local 'voc' (a nil value) [25/07/2012 22:39:55] stack traceback: [25/07/2012 22:39:55] data/npc/scripts/Reborn.lua:59: in function 'callback' [25/07/2012 22:39:55] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay' [25/07/2012 22:39:55] data/npc/scripts/Reborn.lua:7: in function <data/npc/scripts/Reborn.lua:7> SCRIPT: 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 local config = { --[Vocation] = ( Nova Vocation, New Outfit ) [21] = { 22, 137}, [254] = { 255, 351}, [36] = { 37, 148}, [51] = { 52, 144}, [65] = { 66, 152}, [378] = { 379, 451}, [80] = { 81, 150}, [93] = { 94, 150}, [107] = { 108, 509}, [118] = { 119, 118}, [131] = { 132, 34}, [144] = { 145, 15}, [155] = { 156, 15}, [167] = { 168, 173}, [179] = { 180, 178}, [191] = { 192, 184}, [205] = { 206, 190}, [217] = { 218, 221}, [229] = { 230, 281}, [242] = { 243, 60}, [254] = { 255, 351}, [265] = { 266, 334}, [275] = { 276, 80}, [286] = { 287, 338}, [296] = { 297, 198}, } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30025) == 4 then selfSay('You are reborn.', cid) focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30025) ~= 4 then selfSay('Hehe, I say If you READY. You do not have 250 level.', cid) elseif msgcontains(msg, 'reborn') then selfSay('Are you sure? {yes}', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'yes') and talkState[talkUser] ==2 and getPlayerLevel(cid) == 250 then local voc = config[getPlayerVocation(cid)] doPlayerSetVocation(cid, voc[1]) local outfit = {lookType = voc[2]} doCreatureChangeOutfit(cid, outfit) doPlayerAddExp(cid, -(getPlayerExperience(cid)-getExperienceForLevel(1))) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+20000) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+30000) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) setPlayerStorageValue(cid,30025,4) talkState[talkUser] = 0 elseif msgcontains(msg, 'yes') and getPlayerLevel(cid) ~= 250 then selfSay('Desculpe, ' .. getCreatureName(cid) .. '! You need level 250 to reborn.', cid) talkState[talkUser] = 0 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! You must revert or transform to reborn.', cid) talkState[talkUser] = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye.', cid) focus = 0 talk_start = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ALGUEM PODERIA AJUDAR PORFAVOR, VALENDO +REP Editado Julho 26, 2012 por Flaah Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/ Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 27, 2012 Share Postado Julho 27, 2012 tenta isso. if (getPlayerStorageValue(cid, 102087) ~= 1) then setPlayerStorageValue(cid, 102087, 1) setPlayerStorageValue(cid, 102086, 0) muda a sua storage. a q ta e pra kal vai como ali em cima. Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302666 Compartilhar em outros sites More sharing options...
0 Flaah 18 Postado Julho 27, 2012 Autor Share Postado Julho 27, 2012 Meu Login.lua ta assim: E não deu certo, ele continua voltando pra vocation anterior quando o player sai e volta, mesmo eu tendo falado com o NPC Reborn. Login.lua local message = [[Welcome To The Pollo ServerParA Tener El Bless di !Bless ---- blessing !aol ------ amulet of lost !prision -- Magic Wall Prision !]] function onLogin(cid) registerCreatureEvent(cid, "PlayerKill") if (InitArenaScript ~= 0) then InitArenaScript = 1 -- make arena rooms free for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena doPlayerPopupFYI(cid, message) registerCreatureEvent(cid, "PlayerDeath") --registerCreatureEvent(cid, "MEDALS") This is Nahruto's Metal System for killing someone, Dont add this unless you use it.-- registerCreatureEvent(cid, "KilledMonstersCounter") registerCreatureEvent(cid, "playeradvance") registerCreatureEvent(cid, "RepSystem") registerCreatureEvent(cid, "showRep") registerCreatureEvent(cid, "RepLogin") registerCreatureEvent(cid, "task_count") if (getPlayerStorageValue(cid, 30025) ~= 1) then setPlayerStorageValue(cid, 30025, 1) setPlayerStorageValue(cid, 30025, 0) end return TRUE end ALGUEM AJUDA PORFAVOR, VALENDO +REP Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302675 Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 27, 2012 Share Postado Julho 27, 2012 local message = [[Welcome To The Pollo Server ParA Tener El Bless di !Bless ---- blessing !aol ------ amulet of lost !prision -- Magic Wall Prision !]] function onLogin(cid) registerCreatureEvent(cid, "PlayerKill") if (InitArenaScript ~= 0) then InitArenaScript = 1 -- make arena rooms free for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena doPlayerPopupFYI(cid, message) registerCreatureEvent(cid, "PlayerDeath") --registerCreatureEvent(cid, "MEDALS") This is Nahruto's Metal System for killing someone, Dont add this unless you use it.-- if (getPlayerStorageValue(cid, 102087) ~= 1) then setPlayerStorageValue(cid, 102087, 1) setPlayerStorageValue(cid, 102086, 0) end registerCreatureEvent(cid, "KilledMonstersCounter") registerCreatureEvent(cid, "playeradvance") registerCreatureEvent(cid, "RepSystem") registerCreatureEvent(cid, "showRep") registerCreatureEvent(cid, "RepLogin") registerCreatureEvent(cid, "task_count") if (getPlayerStorageValue(cid, 30025) ~= 1) then setPlayerStorageValue(cid, 30025, 1) setPlayerStorageValue(cid, 30025, 0) end return TRUE end tentai. Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302688 Compartilhar em outros sites More sharing options...
0 Flaah 18 Postado Julho 27, 2012 Autor Share Postado Julho 27, 2012 Cara ta com o meeeeeeesmo problema, ele vola pra vocation anterior... Sera que n em q uzar a função: function onLogout(cid) Em? ALGUEM AJUDA PORFAVOR, VALENDO +REP Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302692 Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 27, 2012 Share Postado Julho 27, 2012 eu creio que nao.. mais testa ai Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302696 Compartilhar em outros sites More sharing options...
0 Flaah 18 Postado Julho 27, 2012 Autor Share Postado Julho 27, 2012 (editado) Ixi deu não.. ele continua voltando pra vocation anterior quando ele sai e volta. ALGUEM AJUDA PORFAVOR, VALENDO +REP Editado Julho 27, 2012 por Flaah Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302701 Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 27, 2012 Share Postado Julho 27, 2012 nao sei mais uq tentar. sorry =/ Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302710 Compartilhar em outros sites More sharing options...
0 Flaah 18 Postado Julho 27, 2012 Autor Share Postado Julho 27, 2012 Mais vou te da o +REP pela tentativa ;( PS: Cade o Vodkart quando agente precisa, ;( ALGUEM AJUDA PORFAVOR, VALENDO +REP Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302717 Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 27, 2012 Share Postado Julho 27, 2012 vou pesquisar mais aqui. se o vod nao ajudar antes. Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302719 Compartilhar em outros sites More sharing options...
0 SkySeven 5 Postado Julho 27, 2012 Share Postado Julho 27, 2012 Cara,que tal voce mandar PM pro Vodkart,so uma opniao Fuiz Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302724 Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 27, 2012 Share Postado Julho 27, 2012 na assinatura do vodkart ele boto que nao responde pm =/ Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302728 Compartilhar em outros sites More sharing options...
0 Flaah 18 Postado Julho 27, 2012 Autor Share Postado Julho 27, 2012 Po ele não esta aceitando mensagens ALGUEM AJUDA PORFAVOR, VALENDO +REP Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302737 Compartilhar em outros sites More sharing options...
0 SkySeven 5 Postado Julho 27, 2012 Share Postado Julho 27, 2012 Entao procure um topico q ele esta respondendo recentemente e fale com ele por la Vlw abraços; Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302738 Compartilhar em outros sites More sharing options...
0 theu1995 12 Postado Julho 27, 2012 Share Postado Julho 27, 2012 vou ver o que posso fazer aqui. Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302742 Compartilhar em outros sites More sharing options...
0 SkySeven 5 Postado Julho 27, 2012 Share Postado Julho 27, 2012 Tenta fazer magica ai para ajudar o cara. Foi estranho meu script n dar certo aqui deu certin. Link para o comentário https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/page/2/#findComment-1302745 Compartilhar em outros sites More sharing options...
Pergunta
Flaah 18
Boa Tarde amigos do XTIBIA, estou com um probleminha no meu NPC, ele fica dando o seguinte ERRO no console, quando diz: yes:
SCRIPT:
ALGUEM PODERIA AJUDAR PORFAVOR, VALENDO +REP
Editado por FlaahLink para o comentário
https://xtibia.com/forum/topic/190577-ajuda-npc-reborn-854-ajuda/Compartilhar em outros sites
Top Posters For This Question
17
12
12
5
Popular Days
Jul 27
35
Jul 28
5
Jul 26
4
Ago 17
2
Top Posters For This Question
Flaah 17 posts
Tchubaka 12 posts
SkySeven 12 posts
theu1995 5 posts
Popular Days
Jul 27 2012
35 posts
Jul 28 2012
5 posts
Jul 26 2012
4 posts
Ago 17 2012
2 posts
49 respostass a esta questão
Posts Recomendados