Basic Day Z Food Box (First Script)
All right i'll do my best, so the first part tells the script that I want to spawn a box and where I want it to spawn. The 2nd part are the items I want to spawn in and the 3rd are the backpacks. The 4th and 5th tell the game how many of each item I want to spawn in hence the x50 and x1. Then the last part deletes the box after 90 seconds.
Here it is, full explanation:
Code:
_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 {};
couldnt you take this script and replace something like "FoodSteakCooked", with a class name for a weapon?
Similar Threads
Runescape Hacks / BotsProgress on my first script for RSBot
12 DayZ Mod & Standalone Hacks & CheatsAmmo Box Delete script for server admins!!
5 RuneScape DiscussionsMy First Script Code
19 DayZ Mod & Standalone Hacks & CheatsI Need a Legal Weapons Box Spawning Script
6 GeneralDAVES B-DAY and & first thread of 2007 :D
20

