Jump to content

Recommended Posts

In the Inventory:ApplyDamage function there's this:

local absorbers = {}
    for k, v in pairs(self.equipslots) do
        if v.components.resistance ~= nil and
            v.components.resistance:HasResistance(attacker, weapon) and
            v.components.resistance:ShouldResistDamage() then
            v.components.resistance:ResistDamage(damage)
            return 0
        elseif v.components.armor ~= nil then
            absorbers[v.components.armor] = v.components.armor:GetAbsorption(attacker, weapon)
        end
    end

This is what you want to change. Either you have to override your character's inventory ApplyDamage function or create a custom inventory component which does the same. 

On 9/16/2021 at 3:59 AM, decduck3 said:

In the Inventory:ApplyDamage function there's this:


local absorbers = {}
    for k, v in pairs(self.equipslots) do
        if v.components.resistance ~= nil and
            v.components.resistance:HasResistance(attacker, weapon) and
            v.components.resistance:ShouldResistDamage() then
            v.components.resistance:ResistDamage(damage)
            return 0
        elseif v.components.armor ~= nil then
            absorbers[v.components.armor] = v.components.armor:GetAbsorption(attacker, weapon)
        end
    end

This is what you want to change. Either you have to override your character's inventory ApplyDamage function or create a custom inventory component which does the same. 

why is this inside the inventory component?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...