Ir para conteúdo

Featured Replies

Postado

Verifique os 2 arquivos dessas linhas

 

<event type="death" name="PlayerDeath" script="others/playerdeath.lua" />
<event type="death" name="DropLoot" script="others/droploot.lua" />

 

 

Te ajudei ?? Que tal fazer uma contribuição ?

Doar

  • Respostas 7
  • Visualizações 919
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
39 minutos atrás, DboExplorer disse:

Verifique os 2 arquivos dessas linhas

 


<event type="death" name="PlayerDeath" script="others/playerdeath.lua" />
<event type="death" name="DropLoot" script="others/droploot.lua" />

 

Citar

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        local isPlayer = false
        if killer then
            if killer:isPlayer() then
                isPlayer = true
            else
                local master = killer:getMaster()
                if master and master:isPlayer() then
                    isPlayer = true
                end
            end
        end

        if not isPlayer or not player:hasBlessing(6) then
            player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    item:moveTo(corpse)
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end

 

Erro que aparece no log quando o char morre e loga de novo:

Citar

Lua Script Error: [CreatureScript Interface] 
data/creaturescripts/scripts/others/droploot.lua:onDeath 
data/creaturescripts/scripts/others/droploot.lua:2: attempt to call global 'getPlayerFlagValue' (a nil value) 
stack traceback: 
[C]: in function 'getPlayerFlagValue' 
data/creaturescripts/scripts/others/droploot.lua:2: in function 

 

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

Informação Importante

Confirmação de Termo