kokoekwjd Posted May 19, 2024 Share Posted May 19, 2024 (edited) Hi! I'm using a translator, So what I'm trying to say may not be expressed.T-T - I wanted to create the ability for my custom characters to increase sanity as health goes down, but I can't get the slightest hint. I'm such a idiot... Please give me a clue? If I could make this ability, I would be so happy that I would want nothing more. T-T I'm sorry if I made some mistake! Edited May 23, 2024 by kokoekwjd Link to comment https://forums.kleientertainment.com/forums/topic/156201-solved-can-i-give-ability-for-my-custom-character/ Share on other sites More sharing options...
Haruhi Kawaii Posted May 21, 2024 Share Posted May 21, 2024 On 5/19/2024 at 1:31 PM, kokoekwjd said: Hi! I'm using a translator, So what I'm trying to say may not be expressed.T-T - I wanted to create the ability for my custom characters to increase sanity as health goes down, but I can't get the slightest hint. I'm such a idiot... Please give me a clue? If I could make this ability, I would be so happy that I would want nothing more. T-T I'm sorry if I made some mistake! local function checkhealth(inst) local healpc = inst.components.health:GetPercent() if healpc ~= nil and not inst.components.health:IsDead() then inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE * (1 - healpc) end end In master_postinit inst:ListenForEvent("healthdelta", checkhealth) Link to comment https://forums.kleientertainment.com/forums/topic/156201-solved-can-i-give-ability-for-my-custom-character/#findComment-1715953 Share on other sites More sharing options...
kokoekwjd Posted May 23, 2024 Author Share Posted May 23, 2024 On 5/21/2024 at 3:30 PM, Haruhi Kawaii said: local function checkhealth(inst) local healpc = inst.components.health:GetPercent() if healpc ~= nil and not inst.components.health:IsDead() then inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE * (1 - healpc) end end In master_postinit inst:ListenForEvent("healthdelta", checkhealth) I was too late to check T.T You are amazing and wonderful!!! It works perfectly. You have been a huge help to me Thank you SO much!!! Link to comment https://forums.kleientertainment.com/forums/topic/156201-solved-can-i-give-ability-for-my-custom-character/#findComment-1716414 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