Jump to content

Recommended Posts

I made something very very simple for you just to give you the example of the kind of code you'd need. I kind of just threw it together based on two of my mods so idk if it's elegant but I've tested it and it works.

Put this in your character.lua.

Quote

local function HungerDamageCalc(inst,data)
local hunger = inst.components.hunger:GetPercent()
                    
            if hunger < 0.5 then
                inst.components.combat.damagemultiplier = 1.0
            end
            
            if hunger >= 0.5 then
                inst.components.combat.damagemultiplier = 1.25
            end
end

Put this in the master_postinit function of your character.lua.

Quote

inst:ListenForEvent("hungerdelta", HungerDamageCalc)

Edited by Chesed
  • Like 1

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...