dave9664 Posted April 14, 2015 Share Posted April 14, 2015 Does anyone know how to do this? Basically, I want the character to lose health when sanity is equal to zero, much like when the hunger bar is zero, thanks. Link to comment https://forums.kleientertainment.com/forums/topic/52868-how-to-lose-health-when-sanity-reaches-zero/ Share on other sites More sharing options...
DarkXero Posted April 15, 2015 Share Posted April 15, 2015 @dave9664, inst:ListenForEvent("sanitydelta", function(inst, data) if data.newpercent == 0 and not inst.crazytask then inst.crazytask = inst:DoPeriodicTask(1, function() if inst.components.sanity.current == 0 then inst.components.health:DoDelta(-1, true, "craziness") else inst.crazytask:Cancel() inst.crazytask = nil end end) end end) Link to comment https://forums.kleientertainment.com/forums/topic/52868-how-to-lose-health-when-sanity-reaches-zero/#findComment-629666 Share on other sites More sharing options...
dave9664 Posted April 15, 2015 Author Share Posted April 15, 2015 @DarkXero It's perfect, thank you!! Link to comment https://forums.kleientertainment.com/forums/topic/52868-how-to-lose-health-when-sanity-reaches-zero/#findComment-629929 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