Skip to content

Instantly share code, notes, and snippets.

@GeorgeDettmer
Created December 24, 2014 22:18
Show Gist options
  • Save GeorgeDettmer/504a14bfeb0984494c7c to your computer and use it in GitHub Desktop.
Save GeorgeDettmer/504a14bfeb0984494c7c to your computer and use it in GitHub Desktop.
waitUntil {
_v = _this nearEntities ["Car", 20];
if ({alive _x} count _v > 0) then {
_v = _v select 0;
_bb = boundingBoxReal _v;
_dist = abs ((_bb select 1 select 1) - (_bb select 0 select 1)) - (_this distance _v);
if (_this distance _v > _dist +2) exitWith {};
if (speed _v > 2) then {driver _v forceWeaponFire [currentWeapon _v,currentWeapon _v]};
_v setVelocity [0,0,0]
};
!alive _this
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment