Jump to content

recoil system.. need some help


Recommended Posts

local weap = {shot=false,timer=false}
addEventHandler("onClientPlayerWeaponFire", localPlayer, function()
    local rot = getPedCameraRotation(localPlayer)
    if (isTimer(weap.timer)) then killTimer(weap.timer); end
    if (not weap.shot) then
        setPedCameraRotation(localPlayer, -(rot-0.9))
        weap.shot = true
        weap.timer = setTimer(setPedCameraRotation, 100, 1, localPlayer, -(rot+0.09))
    else
        setPedCameraRotation(localPlayer, -(rot+0.9))
        weap.shot = false
        weap.timer = setTimer(setPedCameraRotation, 100, 1, localPlayer, -(rot-0.09))
    end
end)

how can i make the snap of rotation a bit smoother less fast yet still function properly?

also is there a way to make vertical recoil with setPedCameraRotation?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...