Gear Shift Animation Script (HELP)

after a long time, for some it will be a simple nonsense but I have almost finished my animation script when changing gear. I just need a little help please.

When the vehicle changes gears the animation appears, but as if it were a loop.

I have tried all possible TaskPlayAnim flags and not worked. I have also tried ClearPedTasksImmediately and some other code without result.

How could I make the animation only occur once when changing gear? Thanks in advance

the code:

local vehicleGear = GetVehicleCurrentGear(vehicle)
			if Poslao == -69 then
				if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then
					vehicleGear = 'N'
				elseif vehicleSpeed > 0 and vehicleGear == 0 then
					vehicleGear = 'R'
					loadAnimDict("veh@driveby@first_person@passenger_rear_right_handed@smg") 
                    TaskPlayAnim( GetPlayerPed(-1), "veh@driveby@first_person@passenger_rear_right_handed@smg", "outro_90r", 8.0, 1, 2, 2, 0, 0, 0, 0)
                    Citizen.Wait(1000)						
				elseif vehicleGear == 1 or 2 or 3 or 4 or 5 or 6 then
					loadAnimDict("veh@driveby@first_person@passenger_rear_right_handed@smg") 
                    TaskPlayAnim( GetPlayerPed(-1), "veh@driveby@first_person@passenger_rear_right_handed@smg", "outro_90r", 8.0, 1, 2, 2, 0, 0, 0, 0)
                    Citizen.Wait(1000)				
				end
			end
2 Likes

Do you get that? I need this anim too :smiley: