Sqeemin 1 Posted February 21, 2014 Hello. I'm trying to get an object to identify a type of vehicle (e.g "B_truck_01_box_F") so when it gets close it will execute a script. How would you get the object to identify the id of the vehicle("B_truck_01_box_F")? thanks. Share this post Link to post Share on other sites
cobra4v320 27 Posted February 21, 2014 _count = count (player nearObjects ["B_truck_01_box_F", 50]); if (_count > 0) then {hint "truck near"}; Share this post Link to post Share on other sites
Sqeemin 1 Posted February 21, 2014 thanks the detecting the truck part of it works , but the part that doesn't work is when you start the mission. the script only works at the start of the mission then after that it won't work I've tried making a trigger that repeats and then put _test = execVM "test.sqf" in the init line but it doesn't work. Share this post Link to post Share on other sites
cobra4v320 27 Posted February 21, 2014 (edited) _null = [] execVM "test.sqf" ---------- Post added at 07:55 ---------- Previous post was at 07:48 ---------- I put this into the init.sqf and it went off everytime a truck drove by. [] spawn { while {true} do { private "_truckNear"; _truckNear = nearestObjects [player, ["B_truck_01_box_F"], 30]; if (count _truckNear >= 1) then {hint "truck near"}; sleep 1; }; }; Edited February 21, 2014 by cobra4v320 Share this post Link to post Share on other sites
Sqeemin 1 Posted February 21, 2014 (edited) it works now thanks :bounce3: Edited February 21, 2014 by Sqeemin Share this post Link to post Share on other sites