CrystalPinesGF Posted November 3, 2019 Share Posted November 3, 2019 I want to make the character in my mod able to transform when attacked or below a certain amount of sanity. I do understand some code but not all of it, I looked at Woodie's code but some of the code that allows him to transform I don't really understand, so I was hoping to get a little bit of help with how to make my character transform when attacked or below a certain amount of sanity. Link to comment Share on other sites More sharing options...
CrystalPinesGF Posted November 4, 2019 Author Share Posted November 4, 2019 Let me explain what i'm trying to do, so it's easier for people. I want my character to be able to transform when attacked by a mob and if sanity is below 80 (two ways for him to transform), he's a bit more stronger but losses sanity fast, gains 5 sanity for each mob killed. If he was attacked by a mod he will be stay in that form for a certain amount of time (i'm thinking of making it 2 minutes), every time he is attacked the time resets. Link to comment Share on other sites More sharing options...
Ultroman Posted December 8, 2019 Share Posted December 8, 2019 You can instead listen for the event "attacked" on your character, and check his current sanity then, instead of listening for sanity change, or you can do both. The isInSecondForm bool should make sure that subsequent calls to transform into the current form should not apply the form change. 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