sina alex 1 Posted March 14, 2020 hello to all as you read title i want your help to create an script script file run by execVM "";in trigger act script funuction: We have a few spawn pos+vehicle class _vehlist = [ "CUP_C_Datsun", "CUP_C_Golf4_camo_Civ", "C_Van_01_fuel_F", "C_Truck_02_fuel_F", "C_Offroad_01_F", "C_Tractor_01_F", "C_Van_01_box_F"] call BIS_fnc_selectRandom; _sppos = [ [188.522,4703.44,0.615326], [304.739,4569.2,0.615356], [39.5648,4641.1,0.615417], [76.1484,4609.85,0.615448], [71.9008,4719.1,0.615387], [137.652,5080.41,0.615265], [586.002,4753.71,0.615356] ] call BIS_fnc_selectRandom; then define _entehari _entehari = []; and set its group to west _entehari = creategroup WEST; and i use spawnvehicle fnc to create veh with it crew _entehari1 = [_sppos, 0, _vehlist, _entehari] call BIS_fnc_spawnVehicle; then define _car _car = _entehari1 select 0; and make move command _car Move (getPosATL deftank); every think work correct until where i wand make condition with if to i want spawn gbu at vehicle spawned when it have distance lessthan 30m with my deftank(object) i use this code but it dont work,vehicle spawned fine and move to my deftank but if condition not work if ((_car distance deftank)<30) then {hint"1";}; also i want change hint cmd with gbu create veh,tankyou main code: _vehlist = [ "CUP_C_Datsun", "CUP_C_Golf4_camo_Civ", "C_Van_01_fuel_F", "C_Truck_02_fuel_F", "C_Offroad_01_F", "C_Tractor_01_F", "C_Van_01_box_F"] call BIS_fnc_selectRandom; _sppos = [ [188.522,4703.44,0.615326], [304.739,4569.2,0.615356], [39.5648,4641.1,0.615417], [76.1484,4609.85,0.615448], [71.9008,4719.1,0.615387], [137.652,5080.41,0.615265], [586.002,4753.71,0.615356] ] call BIS_fnc_selectRandom; _entehari = []; _entehari = creategroup WEST; _entehari1 = [_sppos, 0, _vehlist, _entehari] call BIS_fnc_spawnVehicle; _car = _entehari1 select 0; sleep 1; _entehari Move (getPosATL deftank); _di = _car distance deftank < 30; if ((_car distance deftank)<30) then {hint"1";}; Share this post Link to post Share on other sites
POLPOX 779 Posted March 14, 2020 You need waitUntil, not if. _vehlist = selectRandom [ "CUP_C_Datsun", "CUP_C_Golf4_camo_Civ", "C_Van_01_fuel_F", "C_Truck_02_fuel_F", "C_Offroad_01_F", "C_Tractor_01_F", "C_Van_01_box_F" ]; _sppos = selectRandom [ [188.522,4703.44,0.615326], [304.739,4569.2,0.615356], [39.5648,4641.1,0.615417], [76.1484,4609.85,0.615448], [71.9008,4719.1,0.615387], [137.652,5080.41,0.615265], [586.002,4753.71,0.615356] ]; _entehari = []; _entehari = creategroup WEST; _entehari1 = [_sppos, 0, _vehlist, _entehari] call BIS_fnc_spawnVehicle; _car = _entehari1 select 0; sleep 1; _entehari Move (getPosATL deftank); waitUntil {_car distance deftank)<30}; /*some createvehicle and explosion*/ (not tested) 1 Share this post Link to post Share on other sites
Dedmen 2721 Posted March 16, 2020 On 3/14/2020 at 1:36 PM, POLPOX said: (not tested) On 3/14/2020 at 1:36 PM, POLPOX said: _entehari = []; useless On 3/14/2020 at 1:36 PM, POLPOX said: waitUntil {_car distance deftank)<30}; syntax error missing ( 😉 1 Share this post Link to post Share on other sites
sina alex 1 Posted March 18, 2020 On 3/16/2020 at 4:55 PM, Dedmen said: useless syntax error missing ( 😉 waituntil {_car distance deftank <15}; its correct 1 Share this post Link to post Share on other sites