Ir para conteúdo

Featured Replies

Postado

e ai galera , eu estou querendo arrumar script do meu npc aqui ele bloqueia somente pokeball queria que bloqueasse revives tbm. 

Spoiler

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

  • Respostas 6
  • Visualizações 355
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Diretor
11 horas atrás, deadcat321 disse:

e ai galera , eu estou querendo arrumar script do meu npc aqui ele bloqueia somente pokeball queria que bloqueasse revives tbm. 

  Ocultar conteúdo

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

 

 

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

 

 

 

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

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
  • Autor
8 horas atrás, 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 then

npcHandler:say('Coloque suas Pokeball no Cp e seus Revives', cid)
return true
end
end

 

 

 

assim não da ja tinha testado

Postado
  • Diretor
Agora, deadcat321 disse:

assim não da ja tinha testado

qual o erro ?

 

Agora, 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

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

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
  • Autor
27 minutos atrás, 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.

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.6k

Informação Importante

Confirmação de Termo