Jump to content
Sign in to follow this  
yoannis1995

Script IA throw grenade

Recommended Posts

Hi, I'm trying to make an IA throw a flashbang to a specific position and it works but it doesn't work :/

Here is my script.

"fire_flash.sqf":

_soldier = _this select 0;
_cible = _this select 1;
_soldier addMagazine "ACE_Flashbang";
_soldier doWatch _cible;
sleep 2;
tab_fumis = ["ACE_Flashbang","Smokeshell"];
_soldier addEventHandler["fired", {
  _mag = _this select 5;
  _obj = _this select 6;
  sleep 2;
  if (_mag in tab_fumis) then {
_obj setPos (getPos _cible);
  };
}];
sleep 0.5;
_soldier fire ["ACE_FlashbangMuzzle","ACE_FlashbangMuzzle","ACE_Flashbang"];
sleep 1;

And I call it with that:

nul=[t1,target] execVM "fire_flash.sqf";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×