Jump to content
Sign in to follow this  
hunterofdoom

When a player dies fire 5 mortars to his dead body

Recommended Posts

This might work:

in the units init field put this:

null = [this] execVM "MortarsWhenDead.sqf";

MortarsWhenDead.sqf:

_Unit = _this select 0; //the unit
_MortarCreatePos = [getpos _Unit select 0, getpos _unit select 1, 200]; //the position the mortar shells will spawn in. 200 meters above the player.
_MortarType = "Sh_81_HE"; //type of shell will be a 81mm HE shell

while {true} do {
waitUntil {!alive _Unit}; //wait until the unit is dead.
for [{_i=0},{_i<5},{_i=_i+1}] do {
_randomNumber = random 7;
_mortarshell = _MortarType createVehicle _MortarCreatePos;
sleep (3 + _randomNumber); //shells will fall in a random pace, 3 to 10 seconds between shells.
};
waitUntil {alive _Unit}; //would make the script repeat after starting once.
};

not tested!

Edited by Silderoy

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  

×