[Snippet] Simple IED script

Party-approved future science plus handbooks for the revolution
Post Reply
User avatar
wolfenswan
Posts: 1208
Joined: Wed May 25, 2011 4:59 pm

[Snippet] Simple IED script

Post by wolfenswan » Tue Jul 19, 2016 11:52 am

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.

Post Reply