Mouse momentum?

I’m trying to make a script mess up player’s aim by using InputMouseApply, I want the mouse to have momentum, thus it will continue moving along a direction for a while and if a player tries to move it back it has to decelerate first.

But I have fuck of a clue how to do it.

Any ideas?

Take a look at this code I made for my gamemode.

[lua]function GM:Think()
if LocalPlayer():Health() < 45 and LocalPlayer():Alive() then
local ang = LocalPlayer():EyeAngles()

    local mod = 1.5 - (math.Clamp(LocalPlayer():Health(), 20, 100) * 0.02)
    ang.p = ang.p + (math.sin(CurTime()) * 0.1 * mod)
    ang.y = ang.y + (math.cos(CurTime()) * 0.05 * mod)

    LocalPlayer():SetEyeAngles(ang)
end

end
[/lua]

And that code is relevant how?

I assumed that was along the lines of what he wanted, or that it could at least help him, because it is similar to what I think he is trying to do. Just trying to help, no need to be a dick to me.