Evivo Posted May 8, 2015 Share Posted May 8, 2015 Evivo here, I'm coding a mod in which my character has multiple forms. I tried to use Wolfgang's code but I want to use sanity instead of hunger to trigger the transformations. How would I go about that? Link to comment https://forums.kleientertainment.com/forums/topic/53655-mod-sanity-as-a-form-trigger/ Share on other sites More sharing options...
DarkXero Posted May 8, 2015 Share Posted May 8, 2015 (edited) local function MakeDemon(inst) if inst.demon then return end -- changes to demonendlocal function MakeNormal(inst) if not inst.demon then return end -- changes to normalendlocal function onsanitychange(inst, data) local newpercent = data.newpercent if newpercent < 0.5 then MakeDemon(inst) else MakeNormal(inst) endendinst.demon = falseinst:ListenForEvent("sanitydelta", onsanitychange)Wolfgang listens to hunger changes, hungerdelta. Edited May 8, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/53655-mod-sanity-as-a-form-trigger/#findComment-635494 Share on other sites More sharing options...
Evivo Posted May 8, 2015 Author Share Posted May 8, 2015 That's just what I needed! Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/53655-mod-sanity-as-a-form-trigger/#findComment-635497 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