local W=script.Parent local o=1 local O=200 local l=script.Parent:WaitForChild("\072\117\109\097\110\111\105\100")local b=script.Parent:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local N=Enum.HumanoidStateType local R=0 local g=false while true do wait()if b.Velocity.Y<-O then R=R+o g=false l:SetStateEnabled(N.GettingUp,false)l:ChangeState(N.FallingDown)l.Parent.Head.RotVelocity=Vector3.new(0,10,20)end if l.FloorMaterial~=nil and(l.FloorMaterial~=Enum.Material.Air and(l.FloorMaterial~=Enum.Material.Rock and(l.FloorMaterial~=Enum.Material.Water and g)))then g=false l:ChangeState(N.FallingDown)l.Health=l.Health-R R=0 l.Parent.UpperTorso.RotVelocity=Vector3.new(0,-10,20)elseif b.Velocity.Y>-O then wait()R=0 l:SetStateEnabled(N.GettingUp,true)end end

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
