Jump to content

Recommended Posts

I'm wanting to add a feature to a character i am making where if the character's health goes below about 60 then their walk and run speed will be increased but i can't seem to figure out how to do it. (I'm new to this)

 

Does anyone know how i can make this feature?

@codelyoko373,

inst:ListenForEvent("healthdelta", function(inst)    if inst.components.health.currenthealth < 60 then        inst.components.locomotor:SetExternalSpeedMultiplier( inst, "lowhealth", 1.5 )    else        inst.components.locomotor:SetExternalSpeedMultiplier( inst, "lowhealth", 1 )    endend

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
×
  • Create New...