pliskin124 4 Posted August 21, 2015 So far, at the end of my script I have if (is Engineon Truck1) then { null = execVM "Detonation5.sqf"; }; but it doesn't execute set off the explosive. What I want to do is as soon as the unit turns on the car, the vehicle explodes. Any help would be most appreciated. Share this post Link to post Share on other sites
jshock 513 Posted August 21, 2015 https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Engine Truck1 addEventHandler [ "Engine", { if (_this select 1) then { null = [(_this select 0)] execVM "Detonation5.sqf"; }; } ]; Share this post Link to post Share on other sites
pliskin124 4 Posted August 21, 2015 Truck1 addEventHandler [ "Engine", { if (_this select 1) then { null = [(_this select 0)] execVM "Detonation5.sqf"; }; } ]; Tried the script, as well as two modifications and it still did not work. Modification 1 removeAllActions FuelT; [] Spawn { titleText ["You wire the explosive into the vehicle ignition.","PLAIN"]; titleFadeOut 2; sleep 2; titleText ["What could possibly go wrong?","PLAIN"]; titleFadeOut 12; sleep 2; deletevehicle this; Truck addEventHandler [ "Engine", { if (FuelT select 1) then { null = [(FuelT select 0)] execVM "Detonation5.sqf"; }; } ]; Modification 2: FuelT addEventHandler [ "Engine", { if (_this select 1) then { null = [(_this select 0)] execVM "Detonation5.sqf"; }; } ]; Share this post Link to post Share on other sites
Ranwer135 308 Posted August 21, 2015 So far, at the end of my script I have if (is Engineon Truck1) then { null = execVM "Detonation5.sqf"; }; but it doesn't execute set off the explosive. What I want to do is as soon as the unit turns on the car, the vehicle explodes. Any help would be most appreciated. if (isEngineOn Truck1) then {null = execVM "detonation5.sqf";}; You didn't have is connected with EngineOn, just to let you know. ;) Share this post Link to post Share on other sites
pliskin124 4 Posted August 21, 2015 if (isEngineOn Truck1) then {null = execVM "detonation5.sqf";}; You didn't have is connected with EngineOn, just to let you know. ;) Still doesn't work. ;) Share this post Link to post Share on other sites
specie 11 Posted August 21, 2015 I suggest you build in levels of debug so you can see if your state is met e.g with hint "Boom"; Share this post Link to post Share on other sites
Lala14 135 Posted August 21, 2015 so i'm assuming you have a waitUntil before all of that (i would recommend it as it wouldn't activate as when it would go through it would pass it)and then yea just use isEngineOn to return. waitUntil {isEngineOn Truck1}; null = [truck1] execVM "Detonation5.sqf"; hint "boom"; Share this post Link to post Share on other sites
dscha 147 Posted August 21, 2015 If using waitUntil, you should put a sleep in it. waitUntil {sleep 0.1; isEngineOn Truck1}; null = [truck1] execVM "Detonation5.sqf"; hint "boom"; Share this post Link to post Share on other sites
Schatten 287 Posted August 21, 2015 If I'm not mistaken, isEngineOn and engineOn works only with local objects. Share this post Link to post Share on other sites
R3vo 2654 Posted August 21, 2015 while{alive Truck1} do { if (isEngineOn Truck1) then { Truck1 setDamage 1; }; sleep 1; }; What about something like this? No need to overengineer things. Share this post Link to post Share on other sites
pliskin124 4 Posted August 21, 2015 while{alive Truck1} do { if (isEngineOn Truck1) then { Truck1 setDamage 1; }; sleep 1; }; What about something like this? No need to overengineer things. Because the player has set an explosive on the truck and it needs to kill multiple units in a wide area. Share this post Link to post Share on other sites
R3vo 2654 Posted August 21, 2015 You didn't say that in your first post, did you? You can still replace Truck1 setDamage 1; with the execution of your script. Share this post Link to post Share on other sites