Terran4999 0 Posted June 14, 2008 Hey I just want to know if this command is correct: Quote[/b] ] "_X flyinheight 50" foreach units this If this is a valid command why is it not working? I tried putting this in the WP Activation and well as in the Init of units Share this post Link to post Share on other sites
chris330 0 Posted June 29, 2008 Almost right mate. The foreach operator then expects an array to follow. Looks like by using the syntax: foreach this you're trying to run the code line on an object. Try: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x flyinheight 50" foreach units group player or <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x flyinheight 50" foreach units mygroup Share this post Link to post Share on other sites
Pulverizer 1 Posted June 29, 2008 No, that is actually correct syntax and data type wise (hence, no error message). units will return an array of units to forEach from the group or unit that is its parameter (ie, this in the WP onActivation). However, when you use units you will try to set the flyInHeight for the soldier, not the vehicle he's flying. This will work: "vehicle _x flyinheight 5" foreach units this Share this post Link to post Share on other sites
chris330 0 Posted June 29, 2008 I see, so if I did the following: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x dosomething parameter" foreach units player Will this cause the dosomething and parameter code to be excuted on every unit in the group that the player is in? Share this post Link to post Share on other sites