[HELP] Pistol pull out animation wont work while trying to run

So I found a script to where you can pull a pistol from your back rather than a holster. But you are unable to move while pulling your pistol out and would love to be able to move around while pullthing the gun out. Any help would be much appreciated code will be down below:

The script was coming from a mod from https://www.gta5-mods.com/scripts/pull-out-strap

local holstered = true

local weapons = {
“WEAPON_PISTOL”,
“WEAPON_SNSPISTOL”,
“WEAPON_SNSPISTOL_MK2”,
“WEAPON_PISTOL50”,
“WEAPON_REVOLVER”,
“WEAPON_PISTOL_MK2”,
“WEAPON_COMBATPISTOL”,
“WEAPON_HEAVYPISTOL”,
}

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = PlayerPedId()
if DoesEntityExist( ped ) and not IsEntityDead( ped ) and not IsPedInAnyVehicle(PlayerPedId(), true) then
loadAnimDict( “reaction@intimidation@1h” )
if CheckWeapon(ped) then
if holstered then
TaskPlayAnim(ped, “reaction@intimidation@1h”, “intro”, 5.0, 1.0, -1, 30, 0, 0, 0, 0 )
Citizen.Wait(1400)
ClearPedTasks(ped)
holstered = false
end
SetPedComponentVariation(ped, 0, 0, 0, 0)
elseif not CheckWeapon(ped) then
if not holstered then
TaskPlayAnim(ped, “reaction@intimidation@1h”, “outro”, 8.0, 1.0, -1, 30, 0, 0, 0, 0 )
Citizen.Wait(1400)
ClearPedTasks(ped)
holstered = true
end
SetPedComponentVariation(ped, 0, 0, 0, 0)
end
end
end
end)

function CheckWeapon(ped)
for i = 1, #weapons do
if GetHashKey(weapons[i]) == GetSelectedPedWeapon(ped) then
return true
end
end
return false
end

function loadAnimDict( dict )
while ( not HasAnimDictLoaded( dict ) ) do
RequestAnimDict( dict )
Citizen.Wait( 1500 )
end
end

1 Like

You see that ‘30’ in (ped, “reaction@intimidation@1h”, “outro”, 8.0, 1.0, -1, 30, 0, 0, 0, 0 )? Change it to ‘50’

If you look at the actual natives for FiveM and TaskPlayAnim they list what flag numbers you can use. This is from the native page for it:

Odd number : loop infinitely  
Even number : Freeze at last frame  
Multiple of 4: Freeze at last frame but controllable  
01 to 15 > Full body  
10 to 31 > Upper body  
32 to 47 > Full body > Controllable  
48 to 63 > Upper body > Controllable  

hopefully this helps why dsbesire told you to change the number to 50 to set it to upper body while the rest is still controllable.