(machine translation)
This function may be helpful to you,I found this function in a mod made by mh_dt/mhdt ,I didn't make it.
forceActionNode = function(gplayer,node,tree)
local playing
local attempts = 0
repeat
PedSetActionNode(gplayer,"/Global","Act/Globals.act")
PedSetActionNode(gplayer,node,tree)
playing = (PedIsPlaying(gplayer,node,false) or PedIsPlaying(gplayer,node,true)) and PedGetNodeTime(gplayer) == 0
attempts = attempts + 1
until playing or attempts == 100
return playing,attempts
end
How to use:example:
forceActionNode(gplayer,"/Global/BOSS_Darby/Defense/Evade/EvadeLeft/HeavyAttacks/EvadeRightPunch","act/anim/BOSS_Darby.act")
I found this function in a mod made by mh_dt/mhdt ,I didn't make it.
I've tested it, and it works fine with targets.