How can i make a player take damage after running into a specific part at high speeds?

Hello,
I have a silly game idea, and I want to know how I can make a player take damage after running into an object at high speed. I am using a simple momentum script for the player’s speed to slowly increase, here is my code:

while true do wait()
	if script.Parent.Humanoid.MoveDirection == Vector3.new(0, 0, 0) then
		script.Parent.Humanoid.WalkSpeed = 1
	else
		wait(0.25)
		script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + 1
		if script.Parent.Humanoid.WalkSpeed >= 301 then
			script.Parent.Humanoid.WalkSpeed = 300
		end
	end
end

any help is appreciated, thank you in advance :slight_smile:

maybe something like

health - (momentum/max-humanoid-health)

might work

Create a Hitbox, unanchor and set CanCollide to false. And then weld it to player. You can detect it by using .Touched event and then if touched, check it’s a Object and then check the player WalkSpeed.