Jump to content
Sign in to follow this  
lozz08

delete dead units without init

Recommended Posts

So I have waves of zombies set up. Once all the zombies in said wave are dead, another wave comes. I want to delete zombies say 15 seconds after they die.

I looked up ways to delete units when they die but the methods I found all required stuff being put into init fields, and since these zombies are being spawned by undead mod I can't use init fileds.

Share this post


Link to post
Share on other sites

Create a trigger covering the area, where those dead undead are xD

Once activated by "who-u-want" it will delete the corpses.

Cond. this

onActivation: _xhandle = execVM "clearCorpses.sqf"

clearCorpses.sqf:

private ["_aU", "_dU"];

_aU = allUnits;

while {true} do {

sleep 1200;

if (count _aU != count allUnits) then {

_dU = _aU - allUnits;

{hidebody _x} foreach _dU;

sleep 0.5;

{deleteVehicle _x} foreach _dU;

};

_aU = allUnits;

};

btw found it here on the forum ;)

Don't forget to edit the sleeptime to get your 15 secs.

Share this post


Link to post
Share on other sites

Remove Dead script in my sig. Does exactly what you need.

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  

×