Postado Dezembro 14, 2016 8 anos e ai galera , eu estou querendo arrumar script do meu npc aqui ele bloqueia somente pokeball queria que bloqueasse revives tbm. Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 Saffari(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local pokeball = {2391, 2392, 2393, 2394, 12617, 12832} -- whit this pokeballs you CANT enter in the quest. for i = 1, #pokeball do if getPlayerItemCount(cid, pokeball) >= 1 then npcHandler:say('Deposit your pokeballs on the DP!', cid) return true end end if parameters.premium == false and not isPremium(cid) then npcHandler:say('Sorry, you need to be premium account!', cid) return true elseif doPlayerRemoveMoney(cid, parameters.price) == FALSE then npcHandler:say('Sorry, you dont have enought money!', cid) return true end doPlayerSendTextMessage(cid,22,'Good Luck!.') doTeleportThing(cid, parameters.enter) npcHandler:resetNpc() return true end local node1 = keywordHandler:addKeyword({'quest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Nessa {quest} possui monstros muito fortes você esta pronto para enfrenta-los?? Mais antes guarde suas pokebolas no DP....ah você so tem 60 minutos de tempo para realizar essa quest!!!!'}) node1:addChildKeyword({'yes'}, Saffari, {premium = no,price = 0,enter = {x=1235, y=630, z=8}, exit = {x=1235, y=630, z=8}, minutes = 60}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new()) o mais importante é ele bloquear revive já coloquei id do revive junto com a da ball e não deu. se possivel queria que falasse tower em vez de quest para o jogador entrar. E que quando entrasse adicionasse 20 revives ou permitir entrar só com 20 mas lembrando só de broquear os revive se conseguirem já esta bom
Postado Dezembro 15, 2016 8 anos Diretor Em 14/12/2016 em 21:50, deadcat321 disse: e ai galera , eu estou querendo arrumar script do meu npc aqui ele bloqueia somente pokeball queria que bloqueasse revives tbm. Mostrar conteúdo oculto Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 Saffari(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false endlocal pokeball = {2391, 2392, 2393, 2394, 12617, 12832} -- whit this pokeballs you CANT enter in the quest. for i = 1, #pokeball do if getPlayerItemCount(cid, pokeball) >= 1 then npcHandler:say('Deposit your pokeballs on the DP!', cid) return true end end if parameters.premium == false and not isPremium(cid) then npcHandler:say('Sorry, you need to be premium account!', cid) return true elseif doPlayerRemoveMoney(cid, parameters.price) == FALSE then npcHandler:say('Sorry, you dont have enought money!', cid) return true end doPlayerSendTextMessage(cid,22,'Good Luck!.') doTeleportThing(cid, parameters.enter) npcHandler:resetNpc() return true end local node1 = keywordHandler:addKeyword({'quest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Nessa {quest} possui monstros muito fortes você esta pronto para enfrenta-los?? Mais antes guarde suas pokebolas no DP....ah você so tem 60 minutos de tempo para realizar essa quest!!!!'}) node1:addChildKeyword({'yes'}, Saffari, {premium = no,price = 0,enter = {x=1235, y=630, z=8}, exit = {x=1235, y=630, z=8}, minutes = 60}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new()) o mais importante é ele bloquear revive já coloquei id do revive junto com a da ball e não deu. se possivel queria que falasse tower em vez de quest para o jogador entrar. E que quando entrasse adicionasse 20 revives ou permitir entrar só com 20 mas lembrando só de broquear os revive se conseguirem já esta bom local pokeball = {2391, 2392, 2393, 2394, 12617, 12832, ID do REVIVE} -- whit this pokeballs you CANT enter in the quest.for i = 1, #pokeball do if getPlayerItemCount(cid, pokeball) >= 1 thennpcHandler:say('Coloque suas Pokeball no Cp e seus Revives', cid)return true end end Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Dezembro 15, 2016 8 anos Autor Em 15/12/2016 em 09:36, Alexy Brocanello disse: local pokeball = {2391, 2392, 2393, 2394, 12617, 12832, ID do REVIVE} -- whit this pokeballs you CANT enter in the quest.for i = 1, #pokeball do if getPlayerItemCount(cid, pokeball) >= 1 thennpcHandler:say('Coloque suas Pokeball no Cp e seus Revives', cid)return true end end assim não da ja tinha testado
Postado Dezembro 15, 2016 8 anos Diretor Em 15/12/2016 em 17:43, deadcat321 disse: assim não da ja tinha testado qual o erro ? Em 15/12/2016 em 17:44, Alexy Brocanello disse: qual o erro ? tente local pokeball = {2391, 2392, 2393, 2394, 12617, 12832, ID do REVIVE} -- whit this pokeballs you CANT enter in the quest. for i = 1, #pokeball do if getPlayerItemCount(cid, pokeball) >= 1 then npcHandler:say('Coloque suas Pokeball no Cp e seus Revives', cid) return TRUE end end Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Dezembro 15, 2016 8 anos Autor Em 15/12/2016 em 17:44, Alexy Brocanello disse: qual o erro ? tente local pokeball = {2391, 2392, 2393, 2394, 12617, 12832, ID do REVIVE} -- whit this pokeballs you CANT enter in the quest. for i = 1, #pokeball do if getPlayerItemCount(cid, pokeball) >= 1 then npcHandler:say('Coloque suas Pokeball no Cp e seus Revives', cid) return TRUE end end da erro nao so não bloqueia, mas eu consegui aqui coloquei outra função. vlw amigo.
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.