Jump to content

Recommended Posts

Hello, everyone! 

I was trying to make this mod where the weapon damage is based on its current durability, but it doesn't actually calculate the current durability, but the starting one, so I don't know what am I doing wrong. 

    inst:AddComponent("finiteuses")
    inst.components.finiteuses:SetMaxUses(20)
    inst.components.finiteuses:SetUses(20)
    inst.components.finiteuses:SetOnFinished(inst.Remove)
    
    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(inst.components.finiteuses.current * 1.5 + 30)

Any guesses?

7 hours ago, penguin0616 said:

@EduardoAbarca I suggest you take a look at the Hambat, since it does pretty much exactly what you're trying to do.

That being said, that's because you don't have it check the current, only the starting.

I tried looking into it, but I don't understand much of coding. Would you mind explaining how to check it?

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