Author Topic: If player damage=X then player speed decreases  (Read 649 times)

does anyone know how i would detect if a players health is 50 or below and if it is it would decrease the speed of all movment until his/her health gets above 60?

Make a slower datablock then package/parent the damage function.

Can you explain that a little, I'm just a tad bit new to scripting.

Can you explain that a little, I'm just a tad bit new to scripting.

First you'll need to create the slower datablock, like Chrono said. This is one of thosoe "Quake-Like Player," "No-Jet Player," and such. To do so, look in your add-ons folder for something prefixed with "Player_" Open up the .cs file, and you could even copy and paste it. Just lower the speed.

Check the sticky in this forum for how to Package/Parent a function. You'll need to do so with the damage function (search for it).

In the package, you just need to have it so when they're damaged, if their health falls below x, then you change their datablock to the slower one you created.