Hello there, scripting beginner here.
 
	I've been trying to script a simple "spawn system" in the editor  and i am having a hard time with it.
 
	So what i want to achieve is if i execute an action (attached to an object per addAction which leads to my script), i want the script to check if area A (a helipad)  is free. If it is, a MH900 should spawn at area A, if not it should spawn at area B which is next to area A.
 
	So my script (which is most likely riddled with nonsense and errors) looks like that:
 
loc = createLocation ["NameLocal",[8422.922,18207.314,0],10,10]; 
veh = nearestObject [[8423.22,18207.4,0.00146484],"LandVehicle"];
pos = getPos veh;
if (pos in loc) then
{
createVehicle ["C_Heli_Light_01_civil_F" ,[8431.15,18223.9,0.00164795], [], 0, "CAN_COLLIDE"]; //Area A
}
else
{
createVehicle ["C_Heli_Light_01_civil_F" ,[8423.22,18207.4,0.00146484], [], 0, "CAN_COLLIDE"]; // Area B
};
	 It is sort of working but is there any better way to achieve the same effect without creating a location, checking if the nearest object is in the location etc.?
 
	If the vehicle blocking the spawn area is anything but a land vehicle it obviously doesn't work. Is there any way to search for all sorts of vehicles with nearestObject?
 
	How would you script that in order to work with all sorts of vehicles blocking the spawn? If there are any other improvements and/or expansions you would like to suggest, feel free to add it, always happy to learn new Things!
 
	 
 
	Thank you in advance and sorry for bothering with my noobie-errors!