Page 1 of 1

[Snippet] Simple IED script

Posted: Tue Jul 19, 2016 11:52 am
by wolfenswan
You can place IEDs in the editor found under "Props>Weapons>Explosives".

To make them actually dangerous place a trigger on them (covering roughly ~5m² around the area) and synchronize it with all IEDs (or whichever explosives you use) in the killzone.

Set up the trigger to be activated by the player side.

In the condition field put:

Code: Select all

this && isServer && ({!(_x getUnitTrait "engineer") && !(_x getUnitTrait "explosiveSpecialist")} count thisList > 0) && (({alive _x} count synchronizedObjects thistrigger) >0);
In the on activation field put:

Code: Select all

null = "Bo_Mk82" createVehicle (getPos thistrigger);
And that's it. The IED will explode once a unit without the "explosiveSpecialist" or "engineer" trait gets too close. If it's disarmed the trigger won't fire.

Tip: You can set the % of presence for the IED. If it doesn't spawn, the trigger won't fire either.