Jump to content
  • 0
Sign in to follow this  

Custom Static Crate timed with DZAI killed all AI


Can anyone familiar with DZAI help me with a way to time my custom crates to respawn with DZAI custom static AI. I have the randomized crate spawn at server startup, and essentially will be looted once the base has been cleared from all AI. Currently it will "refill" the crate based on a sleep timer. I would like to have the crate refill once the next round of AI spawns based on these values set:

DZAI_respawnTimeMin = 300;
DZAI_respawnTimeMax = 600;

Any help will be appreciated. This is my current loot crate configuration. Thanks for @DAmNRelentless who guided me in creating this script.


if (isServer) then {
_vehicle_999999 = objNull;

	while {true} do {
		_refreshTime = 180;
		_this = createVehicle ["TKVehicleBox_EP1", [726.63354, 9610.8154, 0], [], 0, "CAN_COLLIDE"];
		_vehicle_999999 = _this;
		_this setDir 20;
		_vehicle_999999 setVariable ["ObjectID","1",true];
		_vehicle_999999 setVariable ["permaLoot",true];
		_vehicle_999999 allowDamage false;

		clearWeaponCargoGlobal _this;
		clearMagazineCargoGlobal _this;

		_weaponAmmoArray = [[["DMR_DZ",2],["20Rnd_762x51_DMR",5]],[["L115A3_DZ",2],["5Rnd_86x70_L115A1",5]],[["m107_DZ"],["10Rnd_127x99_m107",5]],[["PMC_AS50_scoped"],["5Rnd_127x99_as50",5]],[["M249_m145_EP1_DZE",2],["200Rnd_556x45_M249",5]]];
		_toolArray = [["ItemEtool",5],["ItemCrowbar",5]];

		_magazineArray = [["150Rnd_127x107_DSHKM",7],["150Rnd_127x108_KORD",7],["2000Rnd_762x51_M134",7],["CinderBlocks",20],["FoodCanRusPork",10],["FoodMRE",10],["ItemBriefcase100oz",2],["ItemComboLock",5],["ItemLightBulb",5],["ItemLockbox",2],["ItemMorphine",10],["ItemPainkiller",10],["ItemPole",2],["ItemSodaMzly",10],["ItemSodaR4z0r",10],["ItemVault",2],["cinder_door_kit",5],["cinder_garage_kit",5],["full_cinder_wall_kit",10],["metal_floor_kit",10],["ItemBloodbag",10]];

		_gemArray = [["ItemEmerald",2],["ItemSapphire",2],["ItemTopaz",2],["ItemCitrine",2],["ItemAmethyst",2]];

		_counterWeaponsAmmo = 0;

		while {_counterWeaponsAmmo < 5} do {
			_randomWeapAmmo = _weaponAmmoArray call BIS_fnc_selectRandom;
			_weaponAmmoArray = _weaponAmmoArray - _randomWeapAmmo;
			_weapon = _randomWeapAmmo select 0;
			_ammo = _randomWeapAmmo select 1;
			_randomAmmo = round(random(_ammo select 1));
			_ammo set[1,_randomAmmo];
			_this addWeaponCargoGlobal _weapon;
			_this addMagazineCargoGlobal _ammo;
			_counterWeaponsAmmo = _counterWeaponsAmmo + 1;
		_counterTool = 0;
		while {_counterTool < 2} do {
			_randomTool = _toolArray call BIS_fnc_selectRandom;
			_tooldArray = _toolArray - _randomTool;
			_this addMagazineCargoGlobal _randomTool;
			_counterTool = _counterTool + 1;
		_counterMagazine = 0;
		while {_counterMagazine < 25} do {
			_randomMagazine = _magazineArray call BIS_fnc_selectRandom;
			_magazineArray = _magazineArray - _randomMagazine;
			_this addMagazineCargoGlobal _randomMagazine;
			_counterMagazine = _counterMagazine + 1;
		_counterGem = 0;
		while {_counterGem < 3} do {
			_randomGem = _gemArray call BIS_fnc_selectRandom;
			_gemArray = _gemArray - _randomGem;
			_this addMagazineCargoGlobal _randomGem;
			_counterGem = _counterGem + 1;
	sleep _refreshTime;



Share this post

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Vladick
      BSBS Server IP:
      Website: https://bsbsepoch.000webhostapp.com/
      Discord: https://discord.gg/PVn8PvG
      Server Features:
      PvPvE Database wiped 1/5/18 ESS V3 spawn selection Coins and Global Banking WAI missions and Roaming DZAI Bandits Customized map additions Skalisky Bridge Skalisky Island Bandit Camp with high loot (fun mission!) Garage Door Opener Virtual Garage Deploy bike Refuel, Repair, Rearm Take clothes Bury Body Butcher Body Locate vehicle with keys and GPS One plot poll per player Indestructible bases Trader Safe Zones Day/Night Schedule 4-hour restarts
    • By FG_Trap
      Made this in my free time awhile ago thought id make it public.
      Right Alt is the key to open the menu.
      Install instructions are inside the download.
      here is a picture of the server menu
    • By stephen21k
      Dose anyone know where to find Updated/Working files for DayZ OverPochIns Taviana?
    • By A Man
      Hey folks,
      this is a release of my Panthera South West Island, that was a huge Military Trader on my last Epoch Panthera Server. It is only the island with loot spawning buildings and without the traders. The island was created by Artjom and me and we both agreed to release it for the community.
      You can use it for Epoch or
      Download here:
      How to add custom Map Content Server Side Epoch
      create a folder in your server.pbo called mapaddons or something like that and put the map addon file in there
      add the following line to the very bottom of your server_functions.sqf in the init folder of your server.pbo
      E.g. for South West Island:
      execVM "\z\addons\dayz_server\mapaddons\south-west-island.sqf";
      Save, pack and upload your server.pbo.

  • Advertisement
  • Supporters
  • Discord

  • Create New...