Sneaky Axolxtl Posted November 5, 2022 Share Posted November 5, 2022 I am making a player mod for my friends. This character gets really upset when hurt so I wanted to make him lose sanity when hurt like Walter. I looked into Walter's code and tried copying some of the code into my player.lua, but it didn't work. Little help? (Note: I have no coding experience AND I'm really dumb so this might be the wrong code.) local function OnHealthDelta(inst, data) if data.amount < 0 then inst.components.sanity:DoDelta(data.amount * ((data ~= nil and data.overtime) and TUNING.WALTER_SANITY_DAMAGE_OVERTIME_RATE or TUNING.WALTER_SANITY_DAMAGE_RATE) * inst._sanity_damage_protection:Get()) end end Link to comment Share on other sites More sharing options...
Sneaky Axolxtl Posted November 5, 2022 Author Share Posted November 5, 2022 I figured it out! 1 Link to comment 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