--Place me in StarterCharacterScripts located in StarterPlayer

local character = script.Parent
local timesby = 1 --Multiplyer
local DamageVelocity = 200 --How fast you go to take damage

local humanoid = script.Parent:WaitForChild("Humanoid")
local humanoidRP = script.Parent:WaitForChild("HumanoidRootPart")
local stateType = Enum.HumanoidStateType
local speed = 0
local fell = false
while true do
	wait()
	if humanoidRP.Velocity.Y < -DamageVelocity then
		speed = speed + timesby
		fell = false
		humanoid:SetStateEnabled(stateType.GettingUp, false)
		humanoid:ChangeState(stateType.FallingDown)
		humanoid.Parent.Head.RotVelocity = Vector3.new(0,10,20)
		
	end 		
	if humanoid.FloorMaterial ~= nil and humanoid.FloorMaterial ~= Enum.Material.Air and humanoid.FloorMaterial ~= Enum.Material.Rock and humanoid.FloorMaterial ~= Enum.Material.Water and fell then
		fell = false
		humanoid:ChangeState(stateType.FallingDown)
		humanoid.Health = humanoid.Health - speed
		speed = 0
		humanoid.Parent.UpperTorso.RotVelocity = Vector3.new(0,-10,20)
	elseif	humanoidRP.Velocity.Y > -DamageVelocity then
		wait()
		speed = 0
		humanoid:SetStateEnabled(stateType.GettingUp, true)
	end
end
