//Checks if any units are fleeing. Does not create any arrays (like the wounded check), for the simple reason that these scripts are most often called together with groups, and groups invariably flee en masse: if one is fleeing, everyone is fleeing.; 

_Array = _this select 0;
_units = _this select 1;

while {{alive _x} count _units > 0 && RUG_DSAI_TerminalDistance != -1} do

{
	while {{fleeing _x} count _units > 0} do
	{
	private ["_Sounds", "_funits", "_random1", "_random2", "_unit"];
	_Sounds = (call _Array) select 0;
	_funits = {alive _x} count _units;	
	_random1 = floor (random _funits);
	_random2 = floor (random (count _Sounds));
	_unit = (_units select _random1);
	if (_unit !=Player && fleeing _unit && alive _unit && vehicle _unit == _unit) then {_unit say (_Sounds select _random2)};
	//hint format ["%1 is fleeing!", _unit];
	sleep ((random 5) + RUG_DSAI_CycleTime);
	if (RUG_DSAI_TerminalDistance == -1) exitWith {};
	};
sleep 4;
};