Applying Velocity to player

Hi, I have this script that when you touch the players head, it pushes you back, but the problem is this script does not work to normal players, only when they are frozen.

Video:

Script:

function onTouched(Hit)
	if Hit.Name == "AnklePart" then
		local OtherChar = Hit.Parent.Parent
		Hit.Velocity = Hit.CFrame.LookVector *-20
	end
end

RightLeg.Touched:Connect(function(Hit)
	onTouched(Hit)
end)

LeftLeg.Touched:Connect(function(Hit)
	onTouched(Hit)
end)

Any help would be appriciated, thanks!

1 Like

Is this a LocalScript or server script? I would also use :ApplyImpulse instead of setting the .Velocity.

Local script (t chars limitation)

How do I use ApplyImpulse?

1 Like

I have tried using ApplyImpulse, but it doesn’t do anything to the character