Search the Community
Showing results for tags 'script loot'.
Found 1 result
-
Hello! I'll try to explain this carefully, but I want to warn you that I do not understand anything about scripting, and I do not speak English either, of which it hurts me a lot in endenter the script. I have a SQF file with the script below, this script adds some random items, so I put that SQF script inside the Init of a "Land_Battery_F" battery so that each battery scattered on the map manages these items. *My file "loot.sqf" if ! ( isServer ) exitWith {}; _loot = nearestObject [player, "Land_Battery_F"]; _weap = selectRandom ["hgun_Pistol_heavy_01_F", "hgun_P07_F", "hgun_Pistol_heavy_02_Yorris_F", "hgun_Rook40_F"]; _qtd1 = random 3; _qtd2 = random 1; _this = _loot; _Loot1 = "groundweaponholder" createVehicle getpos _this; // Creates "groundweaponholder _magazines = getArray (configFile / "CfgWeapons" / _weap / "magazines"); _magazineClass = _magazines call bis_fnc_selectRandom; _Loot1 addWeaponCargoGlobal [_weap, 1]; // creater weapon _Loot1 addMagazineCargoGlobal [_magazineClass, _qtd1]; // creates magazine _Loot1 addItemCargoGlobal ["optic_Arco_blk_F", _qtd2]; // creates optics _Loot1 addBackpackCargoGlobal ["B_AssaultPack_blk", _qtd2]; // creates backpacks _Loot1 attachTo [_this, [0,0,0.62]]; detach _Loot1; inside the Init of a battery ("Land_Battery_F") nul = execVM "target_loot.sqf"; The problem I'm encountering is .. 1. The items only generate on the battery closest to the player; 2. All items from other batteries always generates on the battery closest to the player, so the first battery is with all items generated of other battery placed on the map. I believe the problem is in the line below since it uses the player's position. _loot = nearestObject [player, "Land_Battery_F"]; I searched for solutions in other scripts that I about adding loot, but I always get lost inside them, because as I said, I do not understand anything of script and also do not understand English, because I always use the translator for everything here. The help I'd like is the correct command for each battery placed on the map add your own script item. If anyone can help me in this, I will be very grateful.