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 