Jump to content
  • 0

Erro catch system


Borybiulde

Question

Spoiler

image.thumb.png.117876c2cf85e59386766ccce5d30ce3.png

O erro acontece sempre que pego um pokemon, e quando estou com 6 pokemons o erro duplica !

peço  encarecidamente uma ajuda ? 

 

[21/04/2023 17:10:37] [Error - Action Interface] 
[21/04/2023 17:10:37] In a timer event called from: 
[21/04/2023 17:10:37] data/actions/scripts/Basic/catch.lua:onUse
[21/04/2023 17:10:37] Description: 
[21/04/2023 17:10:37] (luaGetPlayerSlotItem) Player not found

[21/04/2023 17:10:37] [Error - Action Interface] 
[21/04/2023 17:10:37] In a timer event called from: 
[21/04/2023 17:10:37] data/actions/scripts/Basic/catch.lua:onUse
[21/04/2023 17:10:37] Description: 
[21/04/2023 17:10:37] (luaDoItemSetAttribute) Item not found

 

segue catch system da lib e catch da pasta actions 

 

catch system.lua catch.lua

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
local ballcatch = {
    -- Definições das bolas de captura
}

function onUse(cid, item, frompos, item3, topos)
    local item2 = getTopCorpse(topos)
    if item2 == null then
        return true
    end
    
    local owner = getItemAttribute(item2.uid, "corpseowner")
    local pOwner = getPlayerByName(owner)
    if not pOwner or not isCreature(pOwner) or not isPlayer(pOwner) then
        doPlayerSendCancel(cid, "Erro: Jogador não encontrado.")
        return true
    end
    
    if getPlayerStorageValue(cid, 55006) >= 1 then 
        doPlayerSendCancel(cid, "Você não pode capturar nenhum Pokémon enquanto estiver em um duelo.")
        return true
    end
    
    -- Restante do seu código aqui...

    return true
end

function getPlayerSorte()
    local ballS
    if math.random(1, 200) >= 199 then
        ballS = math.random(250, 450)
    else
        ballS = math.random(1, 35)
    end        
    return ballS
end

function getPlayerSorteInNormal()
    local ballS
    if math.random(1, 100) >= 95 then
        ballS = math.random(250, 450)
    else
        ballS = math.random(1, 35)
    end        
    return ballS
end

function getBallsRate(name, id)
    if pokes[name] then
        if isInArray(ballcatch[id].type, pokes[name].type) or isInArray(ballcatch[id].type, pokes[name].type2) or isInArray(ballcatch[id].pokes, name) then
            return 12
        end
    end
    return 8
end



vê se resolve, caso nao for o suficiente eu verifico o outro script

 

Link to comment
Share on other sites

×
×
  • Create New...