Icaruk 14 Posted June 14, 2014 When I call this script, I have one box, I can place it, then remove it, via actions. The problem is when I place one box, I call the script again, then I try to remove the first box, nothing happens, I can just remove the last box I've created. private ["_box"]; _box = "Land_CargoBox_V1_F" createVehicle [0,0,0]; _box attachTo [player, [0,1,1]]; box = _box; ACTION_Place = player addAction ["Place", {detach box; player removeAction ACTION_Place; ACTION_Place = nil;},"",999,false,false,"",'!isNull box']; ACCION_Remove = _box addAction ["Remove", {if ((player distance box) < 3) then {deleteVehicle box;}; },"",999,false,false,"", '']; Any ideas? Share this post Link to post Share on other sites
mikie boy 18 Posted June 14, 2014 (edited) because box only represents the last box you made each time you reference box = _box ; each _box get overridden in the computers memory you are pointing to the last box you made (so to speak) box delete vehicle - needs to point to this (the current box) Edited June 14, 2014 by Mikie boy Share this post Link to post Share on other sites