shaligater Posted June 20, 2016 Share Posted June 20, 2016 So I've been trying to make it so that when my character has any amount of wetness they get a very large sanity drain I have the code working but it's not a big enough drain and it only activates at more than 55 wetness. here's my code local function NAMEHERE(args) if(inst.components.moisture:GetMoisture() > 0) then inst.components.sanity.dapperness = -(Huge) else inst.components.sanity.dapperness = 0 end end how do I make it work how I want it to? Link to comment https://forums.kleientertainment.com/forums/topic/68350-issue-with-mod-code/ Share on other sites More sharing options...
DarkXero Posted June 21, 2016 Share Posted June 21, 2016 inst.components.sanity.custom_rate_fn = function(inst) local moist_sanity = 0 if inst.components.moisture:GetMoisture() > 55 then moist_sanity = -TUNING.DAPPERNESS_LARGE end return moist_sanity end Link to comment https://forums.kleientertainment.com/forums/topic/68350-issue-with-mod-code/#findComment-786396 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