Baddog999 Posted December 22, 2014 Share Posted December 22, 2014 I want my character's stats to change when he goes insane, i have tried multiple things (like: if inst.components.sanity.sane==false then(insert stats here)else(insert more stats here)end This didn't work, when i went insane my stats wouldn't change. I can't figure out how to do this so please help. Link to comment https://forums.kleientertainment.com/forums/topic/47299-need-help-with-character-mod/ Share on other sites More sharing options...
Mobbstar Posted December 22, 2014 Share Posted December 22, 2014 you need to add these lines to your characters main function: inst:ListenForEvent("goinsane",OnInsaneFn)inst:ListenForEvent("gosane",OnSaneFn) Whereas OnInsaneFn and OnSaneFn would have to be declared above and change the stats. local function OnSane(inst) --statsend--the other fnlocal function fn() --this is already there local inst = CreateEntity [...] inst.ListenForEvent("gosane",OnSane) --the other one too return inst --this is already thereend Link to comment https://forums.kleientertainment.com/forums/topic/47299-need-help-with-character-mod/#findComment-591206 Share on other sites More sharing options...
Baddog999 Posted December 22, 2014 Author Share Posted December 22, 2014 Thanks! I didn't think of that! Link to comment https://forums.kleientertainment.com/forums/topic/47299-need-help-with-character-mod/#findComment-591212 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