gremlinafemina Posted April 2, 2023 Share Posted April 2, 2023 hi I am new at modding and can't find any good resources any where on how to add a positive sanity or health gain to a modded character when they are wet, if anyone could help that would be great thank you Link to comment https://forums.kleientertainment.com/forums/topic/146864-how-do-i-add-positive-sanity-or-health-gain-to-a-character-when-they-are-wet/ Share on other sites More sharing options...
-LukaS- Posted April 5, 2023 Share Posted April 5, 2023 (edited) You could do something like this: local regentask local function OnWetnessDelta(inst, data) if inst.components.moisture:GetMoisturePercent() >= 0.3 then -- The '0.3' is the threshold the character needs to exceed to start the boosts inst.components.sanity.externalmodifiers:SetModifier(inst, 'yourvalue') if regentask == nil then regentask = inst:DoPeriodicTask(1, function(inst) inst.components.health:DoDelta(1, true) end) end return end regentask:Cancel() regentask = nil end -- Put this inside your master_postinit \/ inst:ListenForEvent("moisturedelta", OnWetnessDelta) inst.components.sanity.no_moisture_penalty = true -- You would probably also want to set this to true Edited April 5, 2023 by -t- Link to comment https://forums.kleientertainment.com/forums/topic/146864-how-do-i-add-positive-sanity-or-health-gain-to-a-character-when-they-are-wet/#findComment-1628198 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