Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. params [["_dist",50,[1]],["_center",player,[objNull]]]; //in params
  2. _targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets
  3. if (count _targets < 1) exitWith {
  4. systemChat "No compatible targets were found."; //exit if no targets have been found
  5. };
  6. {_x animate ["Terc",0];} forEach _targets; //get all targets to upright pos
  7. {_x addEventHandler ["HIT", { //add EH
  8. (_this select 0) animate ["Terc",1]; //if hit, get to the ground
  9. (_this select 0) RemoveEventHandler ["HIT",0]; //remove EH
  10. }
  11. ]} forEach _targets;
  12. //systemChat "Ready.";
  13.  
  14.  
  15. //swivel targets start here
  16.  
  17. _SwivelTargets = nearestObjects [position _center, ["Target_Swivel_01_base_F"], _dist]; //swivel targets work differently
  18. if (count _SwivelTargets < 1) exitWith {
  19. systemChat "No swivel targets were found.";
  20. };
  21. {_x animate ["Terc",0]; _x setVariable ["BIS_poppingEnabled", false];} forEach _SwivelTargets; //nopop has no effect, it's poppingEnabled now
  22. {_x addEventHandler ["HitPart", {
  23. ((_this select 0) select 0) animate ["Terc",1];
  24. ((_this select 0) select 0) RemoveEventHandler ["HitPart",0];
  25. }
  26. ]} forEach _SwivelTargets;
  27. //systemChat "Swivel ready.";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement