gopgop 1 Posted April 9, 2012 _rtarget = _this select 0; _j = 0; while (_j<5) { if (_rtarget animationPhase "terc" > 0.1) then { _rtarget animate["terc", 1]; _j = _j+1; };}; i have a target that initiates with this animate["terc",1]; then when you get close to it using a trigger it calls target animate["terc",0] then calls this script like so: _nil = target execVM "target.sqf"; all i want to happen is that after the target comes up when the player shoots it it will stay down. after i shoot it it goes down then back up... and it lags the game.. Share this post Link to post Share on other sites
hellfire257 3 Posted April 9, 2012 Add a sleep into the while loop. Share this post Link to post Share on other sites
PELHAM 10 Posted April 9, 2012 (edited) private ["_j","_rtarget"]; _rtarget = _this select 0; _j = 0; while {_j<=5} do { if (_rtarget animationPhase "terc" > 0.1) then { _rtarget animate["terc", 1]; _j = _j+1; sleep 1;//change to whatever delay you need, this is 1 second. }; }; Lots of Syntax errors - corrected. Also do you need a sleep in there or it executes too fast? Not sure why it would cause significant lag as it only executes 5X (unless it was syntax errors?), you might have something wrong somewhere else? Edited April 9, 2012 by PELHAM Share this post Link to post Share on other sites
twirly 11 Posted April 9, 2012 (edited) I have uploaded a little test mission for you here..... http://www.mediafire.com/download.php?923u2052lkc0w37 Targets can stay down, stay up....or popup. Edited April 9, 2012 by twirly Fixed link Share this post Link to post Share on other sites
gopgop 1 Posted April 10, 2012 private ["_j","_rtarget"]; _rtarget = _this select 0; _j = 0; while {_j<=5} do { if (_rtarget animationPhase "terc" > 0.1) then { _rtarget animate["terc", 1]; _j = _j+1; sleep 1;//change to whatever delay you need, this is 1 second. }; }; can someone just make this that when it is executed using a trigger then if the target goes down, then it will stay down... Share this post Link to post Share on other sites
f2k sel 163 Posted April 10, 2012 Try private ["_j","_rtarget"]; nopop=true; _rtarget = _this select 0; _j = 0; while {_j<=5} do { if (_rtarget animationPhase "terc" > 0.1) then { _rtarget animate["terc", 1]; _j = _j+1; sleep 1;//change to whatever delay you need, this is 1 second. }; }; Share this post Link to post Share on other sites