Jump to content
Sign in to follow this  

Recommended Posts

I am trying to create a script that will allow the AV8 to deploy the LGB to an area you click on in the map. After that has been compelted and all units are dead, I want the LaserTargetStaticW vehicle that I created to be deleted.

The problem is that I cannot come up with a script to check if all units are dead with in 20m of the LaserTargetStaticW vehicle that I created. Can anyone help. This is what i have so far.

_nObject = nearestObject [player,];

lasertarget = "LaserTargetWSTatic" createVehicle [0,0,0];

clicked = 0;
hint "Mark the Target";
openmap true;
onMapSingleClick "lasertarget setpos [_pos select 0, _pos select 1, 3]; clicked = 1; openmap false;onMapSingleClick ''; true;";

waitUntil {!visibleMap};

hint "Inbound, Take Cover!";

waituntil { !(alive _nObject)};
hint "ALL DEAD";

I have searched everywhere for the past few days with no luck, so any help would be appreciated!

Share this post


Link to post
Share on other sites

Hi there,

you could create a trigger for this.

This, for example, will check for east units:

_trigger = createTrigger ["EmptyDetector", (getPosATL lasertarget)];
_trigger setTriggerArea [20, 20, 0, false];
_trigger setTriggerActivation ["EAST", "PRESENT", false];
_trigger setTriggerStatements ["{(alive _x)} count thisList < 1;", "", ""];

waitUntil {triggerActivated _trigger};

All trigger related commands can be found here: http://community.bistudio.com/wiki/createTrigger

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  

×