ALPHIVE   14 Posted October 18, 2019 Hi guys 😉  On my server im actually placing random loot spawns, for this, im using this command in INIT of empty helipad :   gun = [  "rhs_weap_pb_6p9",  "rhs_weap_pya",  "rhs_weap_makarov_pm",  "rhs_weap_makarov_pmm",  "rhs_weap_pp2000_folded"  ] call BIS_fnc_selectRandom; Waffe1 = "groundweaponholder" createVehicle getpos this; Waffe1 addWeaponCargo [gun,1]; Waffe1 setPos [getPos this select 0,getPos this select 1,0.00];   It works pretty well, but my problem is the height of the spawn : sometime when i place it in buildings, the script make spawn weapon automaticly to the ground, and not to the house surface  -> So i want use this script to make spawn my stuff at 2nd floor of a building, it will not work because it will spawn on the ground, under the building   My question is : how can i set the height ? in using this scrip  Thank you guys !  Share this post Link to post Share on other sites
chernaruski   338 Posted October 18, 2019 Maybe this command can be handy to you https://community.bistudio.com/wiki/buildingPos or rather newer version https://community.bistudio.com/wiki/BIS_fnc_buildingPositions Share this post Link to post Share on other sites
ALPHIVE   14 Posted October 18, 2019 I dont understand how it works really, sorry im not verry good at scripting 😕 Share this post Link to post Share on other sites
POLPOX Â Â 778 Posted October 18, 2019 gun = selectRandom [ "rhs_weap_pb_6p9", "rhs_weap_pya", "rhs_weap_makarov_pm", "rhs_weap_makarov_pmm", "rhs_weap_pp2000_folded" ]; Waffe1 = "groundweaponholder" createVehicle getpos this; Waffe1 addWeaponCargo [gun,1]; Waffe1 setPosATL getPosATL this; Not tested 1 Share this post Link to post Share on other sites
ALPHIVE   14 Posted October 18, 2019 I found 😉  here is the solution for people who want (in yellow, the number is the height to set)   gun = [  "rhs_weap_pb_6p9",  "rhs_weap_pya",  "rhs_weap_makarov_pm",  "rhs_weap_makarov_pmm",  "rhs_weap_pp2000_folded"  ] call BIS_fnc_selectRandom; Waffe1 = "groundweaponholder" createVehicle getpos this; Waffe1 addWeaponCargo [gun,1]; Waffe1 setPos [getPos this select 0,getPos this select 1,2.00]; Share this post Link to post Share on other sites
chernaruski   338 Posted October 18, 2019 3 hours ago, ALPHIVE said: I don't understand how it works really, sorry im not verry good at scripting 😕 The command , I recommended using, is extracting building position automatically. Positions that are spread inside , including second / third / whatever floors. Will work with other structures. You don't need to hardcode Z values as you did. i.e - place trigger called lootMarker , init the code: weaponArray = [ "arifle_MXC_F", "hgun_P07_F" ]; houseArray = (getMarkerPos "lootMarker") nearObjects ["house",300]; { buildingPositions =[_x] call BIS_fnc_buildingPositions; { weapon = weaponArray select (floor (random (count weaponArray))); itemBox = "WeaponHolderSimulated" createVehicle [0,0,0]; itemBox setPos _x; itemBox addWeaponCargoGlobal [weapon,1]; } forEach buildingPositions; } forEach houseArray; This will spawn random weapons from weaponArray on all positions in all houses in radius of 300 meters from trigger. If you want to you can make some to spawn and some not, as not forEach buildingPosition.  The point is , I recommend using "automated" positions of the buildings models and not hardcoded per attached object like helipad. Share this post Link to post Share on other sites
Smart Games   76 Posted October 18, 2019 Agree with you @chernaruski.  But don't forget: your script is just made for one marker   Share this post Link to post Share on other sites
chernaruski   338 Posted October 18, 2019 its just a quick example , to understand the point Share this post Link to post Share on other sites