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 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 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 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.