Animation not playing


#1

I’m creating a revive script in Lua. I have the revive part working perfectly, but can’t get a working CPR animations.

      local ped = GetPlayerPed(-1)
      loadAnimDict("mini@cpr@char_a@cpr_st")
      loadAnimDict("mini@cpr@char_a@cpr_def")

      TaskPlayAnim(ped, "mini@cpr@char_a@cpr_def", "cpr_intro", 8.0, 1.0, -1, 2, 0, 0, 0, 0)
      Wait(2000)
      TaskPlayAnim(ped, "mini@cpr@char_a@cpr_st", "cpr_pumpchest", 8.0, 1.0, -1, 9, 0, 0, 0, 0)
      Wait(7000)
      TaskPlayAnim(ped, "mini@cpr@char_a@cpr_def", "cpr_success", 8.0, 1.0, -1, 2, 0, 0, 0, 0)

and also, here is my loadAnimDict

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

The code is being executed, but my character in game is not doing anything.