The title says it all. I have tried learning how to do this from free models but none of them work. I don't even know where to start
local Fall_Damage_Begin = 10 local Fall_Damage_Scale = 1 local Player = game.Players.LocalPlayer local Last_Y = Player.Character.Torso.Position.Y function onFreeFall(active) if (active) then Last_Y = Player.Character.Torso.Position.Y else local y_diff = Last_Y - Player.Character.Torso.Position.Y --the difference between the fall start position and the fall end position if (y_diff > Fall_Damage_Begin) then local damage = (y_diff - Fall_Damage_Begin) * Fall_Damage_Scale --damage is based on the extra fall distance after Fall_Damage_Begin, and multiplied by Fall_Damage_Scale Player.Character.Humanoid:TakeDamage(damage) --using the TakeDamage() method means that with a forcefield, the player won't take damage end end end Player.Character.Humanoid.FreeFalling:connect(onFreeFall)
This may work. I havent tested it, but it should. Let me know if it does.
Thank you so much TickTockTheory!
I was able to use your code and tweak it a bit. I tested it in studio and worked great! This is for a R15 rig
local Fall_Damage_Begin = 10 local Fall_Damage_Scale = 1 local me = script.Parent.Name local Player = game.workspace:FindFirstChild(me) local myTorso = Player:WaitForChild("UpperTorso") local Last_Y = myTorso.Position.Y function onFreeFall(active) if (active) then Last_Y = Player.UpperTorso.Position.Y else local y_diff = Last_Y - Player.UpperTorso.Position.Y if(y_diff > Fall_Damage_Begin) then local damage = (y_diff - Fall_Damage_Begin) * Fall_Damage_Scale Player.Humanoid:TakeDamage(damage) end end end Player.Humanoid.FreeFalling:connect(onFreeFall)
If ur to lazy to script there is a Fall Damage plugin https://web.roblox.com/library/199233141/Fall-Damage-Plugin