Bee333 Posted August 7, 2021 Share Posted August 7, 2021 (edited) Hi! I'm making character mod but I don't have knowledge about modding. I want make if my character's health is lower, then I want to give damage boost. Quote local function onhealthchange(inst) if inst.components.health.currenthealth > (50) then inst.components.combat.damagemultiplier = 1.5 elseif inst.components.health.currenthealth > (0) and inst.components.health.currenthealth <= (50) then inst.components.combat.damagemultiplier = 2.5 end end This is my script, and it's not working. What's wrong with that? Or, How can I make my character have that perk? I'm sorry about my poor English. Please help me Edited August 7, 2021 by Bee333 Link to comment https://forums.kleientertainment.com/forums/topic/132517-i-need-help-about-more-damage-with-low-health/ Share on other sites More sharing options...
Monti18 Posted August 11, 2021 Share Posted August 11, 2021 What you did there is just declare a function, but it is called nowhere, that's why it's not working. As you want to make it dependend on the health of the character, add this line to the masterpostinit: inst:ListenForEvent("healthdelta",onhealthchange) This calls your function each time the health of the character changes. 1 Link to comment https://forums.kleientertainment.com/forums/topic/132517-i-need-help-about-more-damage-with-low-health/#findComment-1485050 Share on other sites More sharing options...
Bee333 Posted August 13, 2021 Author Share Posted August 13, 2021 On 8/11/2021 at 3:50 PM, Monti18 said: What you did there is just declare a function, but it is called nowhere, that's why it's not working. As you want to make it dependend on the health of the character, add this line to the masterpostinit: inst:ListenForEvent("healthdelta",onhealthchange) This calls your function each time the health of the character changes. Thanks you so much! It works now Link to comment https://forums.kleientertainment.com/forums/topic/132517-i-need-help-about-more-damage-with-low-health/#findComment-1485652 Share on other sites More sharing options...
Nosidda Posted July 22, 2022 Share Posted July 22, 2022 this thread is prob dead but im trying this and i put the code in for wilson and it did not work Link to comment https://forums.kleientertainment.com/forums/topic/132517-i-need-help-about-more-damage-with-low-health/#findComment-1587553 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