So I am really curious on how I could make fall damage script, but instead of killing the player, it “caps” at a certain damage after a certain distance fallen dealt to the player and gives the player a broken leg, hindering their movement?
How should I go about this, especially since scripting these specific kinds of things is not my strength.
You would make your casual fall damage script and add some stuff.
-Check for falling
-do tick to find fall time
-check if fall time is less than the max damage
-if it is, deal damage, if not, set it to max damage and break the player’s legs still
-
Using math.clamp you can factor in the minimum height to take damage and the maximum. If it hits its max then break the users leg, if not do damage based on your other caps.
x,y,z = distance_fallen, 10(minimum studs fallen), 40(maximum studs fallen)
math.clamp(x, y, z)
If it returns below the minimum(10) dont do damage, if it returns above the maximum break the leg and do damage. Calculate the damage using math.clamp as well based on your desired needs.