_className = "USBasicItemsBox"; //_className = Model you want to spawn
_mypos = getposATL player; //_mypos = Get position of player (vehicle player)/you
_dir = getdir player; //_dir = Gets direction you are looking at
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)]; //Gets your position and modifies it so it spawns in front of you
_magicbox = createVehicle [_className, _mypos, [], 0, "CAN_COLLIDE"]; //_magicbox = Created vehicle; [_className, _mypos, [], 0, "CAN_COLLIDE"] is its spawn line, then, _className = "USBasicItemsBox"; _mypos = Your position +statements that slightly modifies its position
_magicbox setDir _dir; // Set _magicbox direction to player direction (_magicbox _dir = _dir)
_magicbox setposATL _mypos; //Sets _magicbox modified player _mypos
//_items = "ClassNames"
_items = [
"FoodSteakCooked",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanPasta",
"ItemSodaCoke",
"ItemSodaPepsi",
"ItemWaterbottle",
];
//_backpack = "ClassNames"
_backpack = [
"DZ_Backpack_EP1"
];
clearitemsCargoGlobal _magicbox; //Clears the box content (items) globaly
clearBackpackCargoGlobal _magicbox; //Clears the box content (backpacks) globaly
{_magicbox additemsCargoGlobal [_x, 50];} forEach _items; //Add 50 of _items in _magicbox
{_magicbox addBackpackCargoGlobal [_x, 1];} forEach _backpack; //Add 1 of _backpack in _magicbox
sleep 90; //Script is not over, wait 90 seconds until next action
deleteVehicle _magicbox; //Deletes _magicbox (which is a vehicle)
if (true) exitWith {};