PykieSniper Posted November 23, 2016 Share Posted November 23, 2016 Hi all, I'm trying to find a way to allow a character to have their sanity raise when in combat. Would this be a possibility? Thanks Link to comment https://forums.kleientertainment.com/forums/topic/71938-help-raise-sanity-in-combat/ Share on other sites More sharing options...
. . . Posted November 23, 2016 Share Posted November 23, 2016 Inside YOURCHARCTER.lua, inside master_postinit inst:ListenForEvent("onattackother", function(inst, data) -- When ever you attack something you'll gain sanity if not data.target:HasTag("veggie") and not data.target:HasTag("veggie") and not data.target:HasTag("structure") and not data.target:HasTag("wall") and not data.target:HasTag("companion") then -- Don't gain sanity if it isn't a living entity or chester inst.components.sanity:DoDelta(.25) -- 25% of 1 point of sanity, change number to whatever you want end end) Link to comment https://forums.kleientertainment.com/forums/topic/71938-help-raise-sanity-in-combat/#findComment-840781 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