Jump to content
Sign in to follow this  
Tonmeister

random carbomb script

Recommended Posts

I know I am kicking an old thread but I want to add this to my Wasteland mission. Is it a completed project yet? Is it possible to make it a random chance to blow up when someone starts the vehicle instead of a proximity? So, in this case, a bunch of cars spawn and only a few are equipped with the explosive that is wired to the ignition? This would be random of course. Just thinking that it would be hilarious and awesome to see people find a car, get some gear from it and go to start it and go boom. I am also looking into adding a script to make it possible for the car engine to die and have to work on it to get it to start again. If I can add that and make it so that a car may have to worked on to start, and that car happens to be rigged to blow on ignition......epic times. Drive people nuts. Not to mention this is all in Wasteland with ACE mod adding in the ammo cookoff, backblast, etc and JTD fire/smoke......amazing FX.

Share this post


Link to post
Share on other sites

Quick bomb script for your purpose, run it on every client:

while {true} do {
waitUntil {sleep 0.5; vehicle player == player};
waitUntil {sleep 0.5; vehicle player != player;};
waitUntil {(isEngineOn vehicle player) || (vehicle player == player);}
_rnd = random 100;
if ((_rnd > 50) && (vehicle player != player)) then {
	vehicle player setdamage 1;
	_bomb = createVehicle ["Sh_120_HE", position player, [], 0, "CAN_COLLIDE"];
	_bomb2 = createVehicle ["Bo_Mk82", position player, [], 0, "CAN_COLLIDE"];
	sleep 5;
	titleText ["You had some bad luck, someone rigged that car to blow up...","PLAIN"];
};
};

A better way to do this would be with the eventhandler getin.

Edited by Viba

Share this post


Link to post
Share on other sites
Quick bomb script for your purpose, run it on every client:

while {true} do {
waitUntil {sleep 0.5; vehicle player == player};
waitUntil {sleep 0.5; vehicle player != player;};
waitUntil {(isEngineOn vehicle player) || (vehicle player == player);}
_rnd = random 100;
if ((_rnd > 50) && (vehicle player != player)) then {
	vehicle player setdamage 1;
	_bomb = createVehicle ["Sh_120_HE", position player, [], 0, "CAN_COLLIDE"];
	_bomb2 = createVehicle ["Bo_Mk82", position player, [], 0, "CAN_COLLIDE"];
	sleep 5;
	titleText ["You had some bad luck, someone rigged that car to blow up...","PLAIN"];
};
};

A better way to do this would be with the eventhandler getin.

Thanks! I'll give it a go. I assume I should add this to the Client init script in the Client folder?

Share this post


Link to post
Share on other sites

How about making it so that the carbomb does not go off until the player turns off the vehicle? Like it is triggered to activate on a loop that starts only after the player has started the vehicle and the loss of vehicle power sets off the bomb. Kind of like that movie "Speed" where the bus has to go a certain speed or the bomb will detonate? What about that?

Share this post


Link to post
Share on other sites

That script when fixed, makes every car explode not randomly. I changed the RND values and it made no difference. Plus, AI are not affected like they are in the proximity one.

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  

×