Hello,
I'm working on a small script which picks a position from an array and places stuff there, but whenever the Ammo Box spawns, the gear is not accesible. I contacted some other scripters about it and they weren't able to find the error.
//////////////////////////////////////////////////////////////////
private ["_HQ","_unitGroup","_pos","_box1","_squad1","_squad2"];
sleep 1;
/////////////////////////////////////////////////////////////////
[nil,nil,rTitleText,"The Skalisty Island chest has been spawned.", "PLAIN",10] call RE;
//don't edit this, unless you know what you are doing!
_HQ = createCenter east;
_unitGroup = createGroup east;
EAST setfriend [WEST,0];
west setfriend [civilian,0];
//end -- dont edit --
staticcoords = [
[4896.16,10016.5,0]
];
_pos = staticcoords call BIS_fnc_selectRandom;
//PUTS OBJECTS DOWN
//creates the box
_box1 = createVehicle ["GERBasicWeapons_EP1",[0,0,0],[],0,"CAN_COLLIDE"];
_box1 setpos _pos;
//clears the loot that was inside already.
clearmagazineCargoGlobal _box1;
clearweaponCargoGlobal _box1;
_box1 addWeaponCargoGlobal ["M240",2];
_box1 addWeaponCargoGlobal ["M249",1];
_box1 addMagazineCargoGlobal ["ItemBriefcase50oz",1];
_box1 addMagazineCargoGlobal ["ItemGoldBar",5];
//Spawn Unit
//_squad1 = _unitGroup createUnit ["Bandit1_DZ", [(getpos _box1 select 0)+2,(getpos _box1 select 1)-6], [], 10, "FORM"];
//_squad2 = _unitGroup createUnit ["Bandit1_DZ", [(getpos _box1 select 0)-2,(getpos _box1 select 1)+6], [], 10, "FORM"];
//set them to hostile
[_squad1] joinSilent _unitGroup;
[_squad2] joinSilent _unitGroup;
//Add the behaviourS1
_squad1 enableAI "TARGET";
_squad1 enableAI "AUTOTARGET";
_squad1 enableAI "MOVE";
_squad1 enableAI "ANIM";
_squad1 enableAI "FSM";
_squad1 setCombatMode "RED";
_squad1 setBehaviour "COMBAT";
//Gives AI Weapons
_squad1 addWeapon "M240";
_squad1 addMagazine "100Rnd_762x51_M240";
_squad1 addMagazine "100Rnd_762x51_M240";
_squad2 addWeapon "M136";
_squad2 addMagazine "M136";
The "Bandit1_DZ" is a custom classname. Can anyone give me a solution to this problem?
Thanks in advance,
Darryl