jamez_5 1 Posted June 1, 2017 Hey guys. I am trying to do two things. I am making a shooting range and when somebody shoots the target(s) I a noise go off and a hint message to appear. And instead of making two post I would also like for that AI to respawn. Is it possible to make AI respawn without extra sqt files? I know you can make vehicles respawn with just a module placed down and synced. Share this post Link to post Share on other sites
jamez_5 1 Posted June 3, 2017 I know we have an Eisenstein in this community who can figure this out. Share this post Link to post Share on other sites
tpw 2315 Posted June 4, 2017 On 6/1/2017 at 10:03 AM, jamez_5 said: Hey guys. I am trying to do two things. I am making a shooting range and when somebody shoots the target(s) I a noise go off and a hint message to appear. And instead of making two post I would also like for that AI to respawn. Is it possible to make AI respawn without extra sqt files? I know you can make vehicles respawn with just a module placed down and synced. I can't help you with part 2, but for part 1 you should look at adding a "hit" eventhandler to your target. You can script it to do pretty much anything when the target is hit. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Hit Share this post Link to post Share on other sites
jamez_5 1 Posted June 5, 2017 Thank you; however, I found this page before and still didnt understand what my code line should look like? Mind showing me? Share this post Link to post Share on other sites
R3vo 2654 Posted July 19, 2017 Put this in the init field of your target: this addEventHandler ["Hit",{playSound "Alarm"}]; Keep in mind that the code of the eventhandler is only executed locally to the object it was assigned to. Meaning, no other player will hear the sound. If you have further questions, feel free to make a thread here https://forums.bistudio.com/forums/forum/154-arma-3-mission-editing-scripting/ Share this post Link to post Share on other sites
RickRack 0 Posted December 24, 2017 I am creating a shoot house for CQB training. I am using a Popup target script and would like to add to it so that it plays a sound when certain popup targets are hit. IE the Civ or HVT targets. Revo's Code worked fine until i reset the targets which removes the Eventhandler "hit". Below is the reset code. params [["_dist",50,[1]],["_center",player,[objNull]]]; //in params _targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets if (count _targets < 1) exitWith { systemChat "No compatible targets were found."; //exit if no targets have been found }; {_x animate ["Terc",0];} forEach _targets; //get all targets to upright pos {_x addEventHandler ["HIT", { //add EH (_this select 0) animate ["Terc",1]; //if hit, get to the ground (_this select 0) RemoveEventHandler ["HIT",0]; //remove EH } ]} forEach _targets; I am sure it's simple but I can't figure it out. I thought to use if ((_targets iskindof "TargetP_Civ_f") or (_targets iskindof "TargetP_Civ2_f")) then {playSound "Alarm"}; But it didn't seem to work. I am not a scripter but I can usually pick someone else's hard work apart and adapt it to my needs. This one has me stumped. Share this post Link to post Share on other sites