So I've been working all morning on a short little thing that will make an AI play an animation and exit it when shot at/near. I've found a lot of help through old posts on here and I've ended up with this.
[this,"STAND1","ASIS"] call BIS_fnc_ambientAnim;
this addEventHandler ["FiredNear",
{
_this call BIS_fnc_ambientAnim__terminate;
this removeEventHandler [_thisEvent, _thisEventHandler]
}];
And while the script technically works, I'm having a weird AI issue afterwards. The AI sort of tracks me as I run around him, but he makes these weird upper-body flicks. If I stand still, he will shoot either to the left or right of me. The AI hits maybe 1 in 30 shots at me this way. It's really frustrating, makes the AI useless and I can't figure out if it's the script or not.
Video of the AI's reaction.
https://www.youtube.com/watch?v=vhbopQQsNsA
Hoping for help!