Bandit_Boyo Posted May 25, 2024 Share Posted May 25, 2024 I wanna make a character who deals more damage the less sanity he has. Anyone got ideas on how I could achieve this? Link to comment https://forums.kleientertainment.com/forums/topic/156339-help-less-sanity-more-strength/ Share on other sites More sharing options...
Haruhi Kawaii Posted May 30, 2024 Share Posted May 30, 2024 On 5/25/2024 at 9:03 PM, Bandit_Boyo said: I wanna make a character who deals more damage the less sanity he has. Anyone got ideas on how I could achieve this? local function checksanity(inst) local sanity = inst.components.sanity:GetPercent() if sanity ~= nil and not inst.components.health:IsDead() then if sanity == 1 then inst.components.combat.externaldamagemultipliers:RemoveModifier(inst, "damage_from_sanity") else local damage_multiplier = 2 * (1 - sanity) inst.components.combat.externaldamagemultipliers:SetModifier(inst, damage_multiplier, "damage_from_sanity") end end end In master_postinit inst:ListenForEvent("sanitydelta", checksanity) Link to comment https://forums.kleientertainment.com/forums/topic/156339-help-less-sanity-more-strength/#findComment-1718038 Share on other sites More sharing options...
DevilsRoost Posted January 9 Share Posted January 9 (edited) I replied in the wrong place! Can't see where I can delete. Sorry! Edited January 9 by DevilsRoost Link to comment https://forums.kleientertainment.com/forums/topic/156339-help-less-sanity-more-strength/#findComment-1848294 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