Koni 1 Posted March 19, 2012 I'm trying to create a very simple script that I can turn on and off depending on conditions so I can end up being able to use triggers to state attackinprogress=true so the script starts and attackinprogress=false to stop the script. while {attackinprogress} do { nul= execvm "scripts\airportbombs.sqf"}; }; sleep 0.5; }; }; Tried many ways of brackets and script error always says theres missing ] or } no matter what I kep adding :( Thanks Share this post Link to post Share on other sites
neokika 61 Posted March 19, 2012 Hi, while {attackinprogress} do { nul = execvm "scripts\airportbombs.sqf"; sleep 0.5; }; Is that what you mean? Share this post Link to post Share on other sites
Koni 1 Posted March 19, 2012 I can't get this right at all. Ok I have a very simple script that spawns explosions around an air field at predefined locations but I want to be able to add a variable so I can easily start and stop the shelling script. I have placed named objects a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 around the airfield and I'm using a very basic list of createbombs .... bomb = "Bo_GBU12_LGB" createVehicle getPos a1; sleep 2; bomb = "ARTY_R_227mm_HE" createVehicle getPos a2; sleep 4; bomb = "Bo_GBU12_LGB" createVehicle getPos a11; etc and so one, so the script will just run through and explode a bomb at each location once, which takes around 27 seconds to go from start to finish, and this ultra basic list of createvehicle bombs I have called airportbombs.sqf So what I want to be able to do is have the script ready to start and stop by using a variable, I think you call it a variable which would be named attackinprogress for the sake of easy identification, so I can have triggers setup to set the variable to true if enemy units are in the trigger area and start the airportbombs.sqf script then have the variable set to false and stop the airportbombs.sqf script if no enemy units are in the trigger area, which I was trying to use attackinprogress=true or attackinprogress=false. Thanks Share this post Link to post Share on other sites
PELHAM 10 Posted March 19, 2012 (edited) Have you tried: attackinprogress=true attackinprogress=false in the onAct / onDea trigger fields along with the script from Neo above? ---------- Post added at 03:24 PM ---------- Previous post was at 02:51 PM ---------- this works: while {true} do { if (attackinprogress) then { _bomb1 = "Bo_GBU12_LGB" createVehicle getPos a1; sleep 2; _bomb2 = "Bo_GBU12_LGB" createVehicle getPos a2; sleep 2; _bomb3 = "Bo_GBU12_LGB" createVehicle getPos a3; sleep 2; }; }; Edited March 19, 2012 by PELHAM Share this post Link to post Share on other sites
Koni 1 Posted March 19, 2012 Thanks I've got this working how I wanted it to now. while {true} do { if (attackinprogress) then { nul = execvm "scripts\airportbombs2.sqf"; sleep 11; }; }; Share this post Link to post Share on other sites