Nelsonnn

Untitled

Oct 26th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. function createHeliCrashSite()
  2.     if isElement(cargoCol) then
  3.         destroyElement(getElementData(cargoCol,"parent"));
  4.         destroyElement(cargoCol);
  5.     end
  6.     local nr = math.random(7);
  7.     local x,y,z = heliCrashSites[nr][1], heliCrashSites[nr][2], heliCrashSites[nr][3];
  8.         blipo = createBlip (x,y,z,48)
  9.         function blipoo()
  10.     destroyElement (blipo)
  11.         end
  12.         setTimer(blipoo, 3600000 ,1)
  13.         outputChatBox ("[CLASSIC DAYZ]Helicrash he crashed on the map, in a helicopter is a lot of weapons.",getRootElement(),255,255,255,true)
  14.     cargobob = createVehicle(548, x, y, z);
  15.     setElementHealth(cargobob, 0);
  16.     setElementFrozen(cargobob, true);
  17.     cargoCol = createColSphere(x, y, z, 5);
  18.     setElementData(cargoCol, "parent", cargobob);
  19.     setElementData(cargoCol, "helicrash", true);
  20.     setElementData(cargoCol, "MAX_Slots", 0);
  21.     for _,v in ipairs(lootItems["helicrashsides"]) do
  22.         local value =  math.percentChance(v[5]*3.5, math.random(1, 5));
  23.         setElementData(cargoCol, v[1], value);
  24.         local ammoData,_ = getWeaponAmmoType(v[1], true);
  25.         if (ammoData and value > 0) then
  26.             setElementData(cargoCol, ammoData, math.random(1, 5));
  27.         end
  28.     end
  29.     setTimer(createHeliCrashSite, 3600000, 1);
  30.  
  31. end
  32. createHeliCrashSite()
Advertisement
Add Comment
Please, Sign In to add comment