patpowercat 7 Posted May 18, 2016 I'm a novice at scripting, but I have been working on modifying a script I found. Instead of spawning a single group in a helicopter, I want to spawn 2 in the helicopter. It works great with a single group, but when I try and add in the second group, I get an error that I am missing a "{". Any ideas? Script with two groups: _crew1 = []; _airframe1 = []; _mygroup = []; _mygroup2 =[]; if (isServer) then { _crew1 = creategroup WEST; _airframe1 = [getMarkerPos "Mk1", 140, "B_Heli_Transport_03_F", _crew1] call BIS_fnc_spawnVehicle; _wp1 = _crew1 addWaypoint [(getmarkerpos "Max"), 0]; _wp1 setWaypointType "TR UNLOAD"; _wp1 setWaypointSpeed "FAST"; _wp1 setwaypointstatements ["this land 'land'"]; _wp2 = _crew1 addWaypoint [(getmarkerpos "Mk1"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "FAST"; _wp2 setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; _mygroup = [getMarkerPos "Mk1", WEST, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfAssault")] call BIS_fnc_spawnGroup; _wp1a = _mygroup addWaypoint [getmarkerpos "Max1", 0]; _wp1a setWaypointType "LOITER"; _mygroup2 = [getMarkerPos "Mk1", WEST, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_ReconTeam")] call BIS_fnc_spawnGroup; _wp1b = _mygroup2 addWaypoint [getmarkerpos "Max2", 0]; _wp1b setWaypointType "LOITER"; sleep .5; _mygroup = _mygroup; { _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup; }; _mygroup2 = _mygroup2; { _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup2; }; Spawn with one group: (working) _crew1 = []; _airframe1 = []; _mygroup = []; if (isServer) then { _crew1 = creategroup WEST; _airframe1 = [getMarkerPos "Mk1", 140, "B_Heli_Transport_03_F", _crew1] call BIS_fnc_spawnVehicle; _wp1 = _crew1 addWaypoint [(getmarkerpos "Max"), 0]; _wp1 setWaypointType "TR UNLOAD"; _wp1 setWaypointSpeed "FAST"; _wp1 setwaypointstatements ["this land 'land'"]; _wp2 = _crew1 addWaypoint [(getmarkerpos "Mk1"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "FAST"; _wp2 setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; _mygroup = [getMarkerPos "Mk1", WEST, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfAssault")] call BIS_fnc_spawnGroup; _wp1a = _mygroup addWaypoint [getmarkerpos "Max1", 0]; _wp1a setWaypointType "LOITER"; sleep .5; _mygroup = _mygroup; { _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup; }; _mygroup2 = _mygroup2; { _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup2; }; I don't understand why I am getting this error. Share this post Link to post Share on other sites
johnnyboy 3797 Posted May 18, 2016 Delete the extra }; that is the 4th line from the bottom. Consider using Notepad++ as your editor. You can get a .sqf extension for it (google for it), and it makes spotting missing or extra brackets and parentheses really easy. It also colors variables and commands differently, making the code easier to read while you are working on it. Share this post Link to post Share on other sites
patpowercat 7 Posted May 18, 2016 Perfect thanks on both accounts! 1 Share this post Link to post Share on other sites
Von Quest 1163 Posted May 19, 2016 ...that script looks familiar. 1 Share this post Link to post Share on other sites
R3vo 2654 Posted May 19, 2016 ...that script looks familiar. Who cares. This script is so basic, my mom could have written it. 2 Share this post Link to post Share on other sites
sarogahtyp 1109 Posted May 20, 2016 Who cares. This script is so basic, my mom could have written it. I ve great respect for ur mom now... 1 Share this post Link to post Share on other sites