Jump to content

Need help with a stat change. I am not a very good coder


Recommended Posts

For one of my character mods i would like to scale the movement speed with the player's sanity. I have the code ready but for some reason I can't seem to get it to work quite right. The speed only changes if the character dies then revives or reloads into the world.

Link to comment
Share on other sites

@lochaodhan,

put that in your characterprefab near the end of the master_init:

inst:ListenForEvent("sanitydelta", function(inst) inst.components.locomotor.runspeed=TUNING.WILSON_RUN_SPEED*inst.components.sanity.current/100 end)
Edited by Seiai
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...