Ir para conteúdo
  • 0

npc que bloqueia item


Azon25

Pergunta

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 so com 20

 

mas lembrando só de broquear os revive se conseguirem ja esta bom

 

id do revive = 12344

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
local revive = {itemid = 12344, max_count = 20}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction Saffari(cid, message, keywords, parameters, node)    if not npcHandler:isFocused(cid) then        return false    end    if getPlayerItemCount(cid, revive.itemid) > revive.max_count then        npcHandler:say("To enter here, you can only carry "..revive.max_count.." revive(s). Deposit the rest on the DP, please.", cid)        return true    end    if not parameters.premium and not isPremium(cid) then        npcHandler:say('Sorry, you need to be premium account!', cid)        return true    elseif not doPlayerRemoveMoney(cid, parameters.price) 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 trueendlocal node1 = keywordHandler:addKeyword({'tower'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Nessa {tower} 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())

 

Link para o comentário
Compartilhar em outros sites

  • 0
18 horas atrás, zipter98 disse:
local revive = {itemid = 12344, max_count = 20}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction Saffari(cid, message, keywords, parameters, node)    if not npcHandler:isFocused(cid) then        return false    end    if getPlayerItemCount(cid, revive.itemid) > revive.max_count then        npcHandler:say("To enter here, you can only carry "..revive.max_count.." revive(s). Deposit the rest on the DP, please.", cid)        return true    end    if not parameters.premium and not isPremium(cid) then        npcHandler:say('Sorry, you need to be premium account!', cid)        return true    elseif not doPlayerRemoveMoney(cid, parameters.price) 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 trueendlocal node1 = keywordHandler:addKeyword({'tower'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Nessa {tower} 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())

 

eu fiz aqui com esse e umas gambiarra

if getPlayerItemCount(cid,12344) >= 1 then

     selfSay("Coloque seus revives no DP!")

    return true

  end

 

dps add  

doPlayerAddItem(cid,12344,20)

 

mas seu esta ótimo tbm. obgd

Editado por Azon25
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...