Script Is not detecting ground

Im trying to have the player fall down fast when i press R and after 0.8 seconds go down even faster and then after another 0.8 seconds even faster and so on, until i hit the ground but when i hit the ground it doesn’t register that i hit the ground.

	if AttackKey == "R" then
		if player.Character.Humanoid.FloorMaterial == Enum.Material.Air then
			print("air")
			local bodyVelocity = Instance.new("BodyVelocity")
			bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
			bodyVelocity.Velocity = player.Character.HumanoidRootPart.CFrame.UpVector * -50
			bodyVelocity.Parent = player.Character.HumanoidRootPart
			repeat
			wait(0.8)
			bodyVelocity.Velocity = bodyVelocity.Velocity * 2
			until player.Character.Humanoid.FloorMaterial ~= Enum.Material.Air 
print("tocuhed ground")
			bodyVelocity:Destroy()
		end
end

Well you can check if the character has landed by doing this

until player.Character.Humanoid.GetState(Enum.HumanoidStateType.Landed)

so replace the below code with the one above

until player.Character.Humanoid.FloorMaterial ~= Enum.Material.Air
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.