Ir para conteúdo

Featured Replies

Postado

Boa noite, estou com um bug no !bless utilizo ele, funciona, faz a animação, gasta a quantia de dinheiro porém não dá as blesses. Já pesquisei bugs de todos os tipos, ainda não consegui encontrar em lugar algum.

  • Respostas 12
  • Visualizações 2.1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
6 horas atrás, Guumew disse:

Boa noite, estou com um bug no !bless utilizo ele, funciona, faz a animação, gasta a quantia de dinheiro porém não dá as blesses. Já pesquisei bugs de todos os tipos, ainda não consegui encontrar em lugar algum.

 

Utilize essa que uso no meu ot.

 

local bless = {1, 2, 3, 4, 5}
local cost = 120000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "Você ja tem todas as bless.")
return TRUE
end
end

if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "Agora você esta protegido!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "Você precisa de 120k para fazer a bless.")
end
return TRUE
end 

 

Postado
  • Autor
19 horas atrás, JcA disse:

 

Utilize essa que uso no meu ot.

 


local bless = {1, 2, 3, 4, 5}
local cost = 120000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "Você ja tem todas as bless.")
return TRUE
end
end

if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "Agora você esta protegido!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "Você precisa de 120k para fazer a bless.")
end
return TRUE
end 

 

Mesmo problema, gastando dinheiro porém não tá funcionando a bless. O ot é OTX, Global.

Postado

boa noite , infelizmente esse bug ate hoje procuro a solução e nao acho a unica solução foi eu criar um npc que compra bless =)

 

caso queira .

 

 

 


 

Blessing.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Blessing" script="blessing.lua" walkinterval="2000">
    <health now="100" max="100"/>
    <look type="326"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Olá, |PLAYERNAME|!  pode adquirir {todas} as blessings por 10 golds Aproveite."/>
    </parameters>
</npc>

 
 

 

 

blessing.lua

 

 


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


function creatureSayCallback(cid, type, msg)


    if(not npcHandler:isFocused(cid)) then
        return FALSE
    end

local bless = {1, 2, 3, 4, 5}
if msgcontains(msg, "all") or msgcontains(msg, "all blessings") or msgcontains(msg, "todas as bless") or msgcontains(msg, "todas")  then
         selfSay("Deseja pagar 10 golds por todas blessings?", cid)
         talkState[cid] = 6
     elseif msgcontains(msg, "yes") and talkState[cid] == 6 then
for i = 1, table.maxn(bless) do
     if getPlayerBlessing(cid, bless) then
       return selfSay("Voce ja possui todas blessings.", cid)
end
end
if not isPremium(cid) then
       return selfSay("Voce precisa de premium account para comprar todas as blessings.", cid)
        end
        if not doPlayerRemoveMoney(cid, 100000) then
return selfSay("Voce nao possui dinheiro suficiente.", cid)
end
local bless = {1, 2, 3, 4, 5}


          selfSay("Voce adquiriu todas as blessings.", cid)
          talkState[cid] = 0
 for i = 1, table.maxn(bless) do
 doPlayerAddBlessing(cid, bless)
 end


     elseif msgcontains(msg, 'no') and talkState[cid] == 6 then
     selfSay("Qual voce deseja entao?", cid)
     talkState[cid] = 0
     end
end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 
 

 

 

test este script.

me diga se deu certo.

 



 

function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
        return 0
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
            doSendMagicEffect(getPlayerPosition(cid), 29)
            doCreatureSay(cid,'I have been blessed by the gods!', TALKTYPE_ORANGE_1)
        else
            doPlayerSendCancel(cid, "You need 50k to get blessed!")
        end
    end    
    return 1
end


 

Editado por matheusjp2 (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.

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