jimsolo 12 Posted May 25, 2009 (edited) Looked around but couldnt find a solution for this. Im trying to keep a machine gun manned so that when the gunner dies another guy walks up and replaces him. I been trying things like this but the AI wont respond at all: _mg = _this select 0 _crew = _this select 1 #loop1 ?!Alive _mg : loop2 goto "loop1" #loop2 _crew assignasgunner _mg _crew moveingunner _mg #exit exit I also tried using groups and without still no luck. Do I need the script to watch for the static weapon to die or the crewman? If its the crewman does that mean I need to start him out seperate so I can name him and then have him mount the weapon? thx in advance, Jim Edited May 25, 2009 by JimSolo Share this post Link to post Share on other sites
snkman 351 Posted May 25, 2009 Try this: private ["_mg","_crew","_count","_unit"]; _mg = _this select 0; _crew = _this select 1; while { (alive gunner _mg) } do { sleep 1; }; _count = 0; while { (_count < count crew) } do { _unit = (_crew select _count); _count = _count + 1; If (alive _unit) exitWith { _unit assignasgunner _mg; }; }; Note: This is .sqf so call it with execVM Share this post Link to post Share on other sites
jimsolo 12 Posted May 25, 2009 (edited) eh how would I call this exactly? I get a error when I use this as a .SQF I tried calling with: _mg = mg1 execVM "nest1.sqf" and the script runs but the "_mg = mg1" part makes no sense to me because I am use to [mg1,mg2] exec "nest1.sqs" formatIts dropping multiple errors with this one. Can someone show me how to do this with a SQS or give further details as the wicki is waaay too vague on proper use of .sqf files. thx Edited May 25, 2009 by JimSolo Share this post Link to post Share on other sites
Evil_Echo 11 Posted May 26, 2009 _mg = [mg1, crew1, 5, myteam] execVM "nest1.sqf"; Share this post Link to post Share on other sites