amirtech 0 Posted October 20, 2017 Hi Guys, I Have Problem , I Want to Create A Trigger for AI ,when i go to a trigger int script is activated and when i Coming out of trigger , Int script is disable my int scriptAI is (((( this dofire target1; this allowdamage false; this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] )))) Please help :( tnx Share this post Link to post Share on other sites
pierremgi 4919 Posted October 20, 2017 your init field in AI is not the best way to script something. anyway, just add a triggerActivated condition. Say you named your trigger trig1: if (isServer) then { this spawn { waitUntil {sleep 0.5; triggerActivated trig1}; _this dofire target1; _this allowdamage false; _this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] } }; 1 Share this post Link to post Share on other sites
amirtech 0 Posted October 21, 2017 On 10/20/2017 at 8:41 PM, pierremgi said: your init field in AI is not the best way to script something. anyway, just add a triggerActivated condition. Say you named your trigger trig1: if (isServer && triggerActivated trig1) then {this dofire target1; this allowdamage false; this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] }; if (isServer && triggerActivated trig1) then {this dofire target1; this allowdamage false; this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] }; Where to enter the code int solider or trig1 see my photo Share this post Link to post Share on other sites
pierremgi 4919 Posted October 21, 2017 Referring to <this> for doFire and so on, <this> must be the unit(s) who fire. So init field of each units supposed to fire. But your script will not work as you want to shoot civilians. Search for other topics to make it work. Something to be tested: if (isServer) then { this spawn { waitUntil {sleep 0.5; triggerActivated trig1}; while {alive _this} do { _this doTarget target1; if ((_this weaponDirection primaryWeapon _this)vectorDotProduct vectorNormalized (getpos b1 vectordiff getpos _this) >0.99) then { _this forceWeaponFire [primaryWeapon _this,currentweaponMode _this] }; }; }; }; 1 Share this post Link to post Share on other sites