EduardoAbarca Posted November 12, 2020 Share Posted November 12, 2020 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? Link to comment Share on other sites More sharing options...
penguin0616 Posted November 12, 2020 Share Posted November 12, 2020 @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. 2 Link to comment Share on other sites More sharing options...
EduardoAbarca Posted November 13, 2020 Author Share Posted November 13, 2020 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? Link to comment Share on other sites More sharing options...
penguin0616 Posted November 13, 2020 Share Posted November 13, 2020 #1: Figure out what the durability change event name is #2: Listen for the event on your instance #3: Apply your formula when the event triggers #4: Set damage to freshly calculated number 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now