Boomyman Posted November 20, 2020 Share Posted November 20, 2020 Hi, I a a beginner coder that is trying to make wormwoods fertilization mechanic also give him max health up to a certain degree. what would I need to do to accomplish this. Link to comment https://forums.kleientertainment.com/forums/topic/123570-how-to-make-wormwoods-fertilizer-give-him-max-health/ Share on other sites More sharing options...
Ziro2k Posted November 27, 2020 Share Posted November 27, 2020 (edited) Seems like you will need to override the Fertilizer:Heal component function to do this, like so (in modmain): AddClassPostConstruct("components/fertilizer", function(self) local _Heal = self.Heal function self:Heal(target) if self.planthealth ~= nil and target.components.health ~= nil and target.components.health.canheal and target:HasTag("healonfertilize") then local maxhealth = target.components.health.maxhealth --I set the maxhealth to increase by 10, but you can determine this value however you want. local bonushealth = 10 target.components.health.maxhealth = maxhealth + bonushealth target.components.health:ForceUpdateHUD(true) end _Heal(self, target) end end) Edited November 27, 2020 by Ziro2k Link to comment https://forums.kleientertainment.com/forums/topic/123570-how-to-make-wormwoods-fertilizer-give-him-max-health/#findComment-1396264 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