Im looking for an easy, effective way to randomize loot (weapons, ammo, toolbelt items, food, meds and building supplies) in static crate. I have a placed crate already and populated with stuff but i would like to have this random on spawn. Also i would like to know how to have this crate stay for 2 hours then destroy and respawn 15 min later. This is what my customLootCrate.sqf looks like :
Quoteif (isServer) then {
_vehicle_9090 = objNull;
if (true) then
{
_this = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, 0], [], 0, "CAN_COLLIDE"];
_vehicle_9090 = _this;
_this setDir -182.5;
_vehicle_9090 setVariable ["ObjectID","1",true];
_vehicle_9090 setVariable ["permaLoot",true];clearWeaponCargoGlobal _this;
clearMagazineCargoGlobal _this;
_this addWeaponCargoGlobal ["BAF_LRR_scoped",2]; //
_this addWeaponCargoGlobal ["DMR_DZ",1];
_this addWeaponCargoGlobal ["[M24_des_EP1",2];
_this addWeaponCargoGlobal ["[FNFAL_DZ",2];
_this addWeaponCargoGlobal ["[Mk48_CCO_DZ",2];
_this addWeaponCargoGlobal ["[M240_DZ",2];
_this addWeaponCargoGlobal ["[G17_FL_DZ",2];
_this addWeaponCargoGlobal ["[M9_SD_DZ",2];
_this addMagazineCargoGlobal ["20Rnd_762x51_DMR",20];
_this addMagazineCargoGlobal ["5Rnd_762x51_M24",20];
_this addMagazineCargoGlobal ["20Rnd_762x51_FNFAL",20];
_this addMagazineCargoGlobal ["100Rnd_762x54_PK",20];
_this addMagazineCargoGlobal ["100Rnd_762x51_M240",20];
_this addMagazineCargoGlobal ["17Rnd_9x19_glock17",20];
_this addMagazineCargoGlobal ["15Rnd_9x19_M9SD",20];
_this addWeaponCargoGlobal ["ItemToolbox",5];
_this addWeaponCargoGlobal ["ItemCrowbar",5];
_this addWeaponCargoGlobal ["ItemEtool",5];
_this addWeaponCargoGlobal ["Binocular_Vector",5];
_this addWeaponCargoGlobal ["ItemGPS",5];
_this addWeaponCargoGlobal ["ItemHatchet",5];
_this addWeaponCargoGlobal ["NVGoggles",5];
_this addMagazineCargoGlobal ["ItemLockbox",2];
_this addMagazineCargoGlobal ["ItemPole",20];
_this addMagazineCargoGlobal ["ItemComboLock",2];
_this addMagazineCargoGlobal ["ItemGenerator",3];
_this addMagazineCargoGlobal ["ItemVault",2];
_this addMagazineCargoGlobal ["ItemCorrugated",20];
_this addMagazineCargoGlobal ["plot_pole_kit",2];
_this addMagazineCargoGlobal ["ItemWire",10];
_this addMagazineCargoGlobal ["ItemTankTrap",10];
_this addMagazineCargoGlobal ["ItemSandbag",10];
_this addMagazineCargoGlobal ["CinderBlocks",40];
_this addMagazineCargoGlobal ["MortarBucket",20];
_this addMagazineCargoGlobal ["ItemBloodbag",5];
_this addMagazineCargoGlobal ["ItemEpinephrine",5];
_this addMagazineCargoGlobal ["ItemMorphine",5];
_this addMagazineCargoGlobal ["ItemPainkiller",5];
_this addMagazineCargoGlobal ["ItemAntibiotic",5];
_this addMagazineCargoGlobal ["ItemBandage",5];
_this addMagazineCargoGlobal ["ItemSeaBassCooked",10];
_this addMagazineCargoGlobal ["ItemTunaCooked",10];
_this addMagazineCargoGlobal ["ItemSodaR4z0r",5];
_this addMagazineCargoGlobal ["ItemSodaMdew",5];
_this addMagazineCargoGlobal ["ItemSodaOrangeSherbet",5];
_this addMagazineCargoGlobal ["ItemSodaRbull",5];
_this addMagazineCargoGlobal ["PartEngine",5];
_this addMagazineCargoGlobal ["PartVRotor",5];
_this addMagazineCargoGlobal ["PartGlass",5];
_this addMagazineCargoGlobal ["PartWheel",5];
_this addMagazineCargoGlobal ["PartGeneric",5];
_this addMagazineCargoGlobal ["ItemJerrycan",5];
_this setPos [4434.3223, 10632.069, 0];
};
};
Thanks for any help in advance.