Antorugby 2 Posted October 24, 2013 Hello, I'm trying to make a towing script but I'm pretty new at scripting so I need some help, here's my code _vehicletow = vehicle player; _towarray = nearestObjects [ _vehicletow, ["Car"], 10]; if (count _towarray > 0 ) then { tow = player addAction ["Tow", "towing.sqf"]; }; But it's not working, if I use player instead of _vehicletow is working, what am I missing? Share this post Link to post Share on other sites
Johnson11B2P 3 Posted October 24, 2013 So you want the vehicle to have an addAction instead of the player? Share this post Link to post Share on other sites
Antorugby 2 Posted October 24, 2013 Yeah, but I found a script from BTC, so I don't need it anymore. Inviato dal mio GT-I9300 con Tapatalk Share this post Link to post Share on other sites
J. Schmidt 10 Posted October 26, 2013 I'm not good at scripting but try this: _vehicletow = vehicle player; _towarray = nearestObjects [ _vehicletow, ["Car"], 10]; if (count _towarray > 0 ) then { tow = _vehicletow addAction ["Tow", "towing.sqf"]; }; You may need to add a private array, but I'm not sure: private ["_vehicletow","_towarray"]; _vehicletow = vehicle player; _towarray = nearestObjects [ _vehicletow, ["Car"], 10]; if (count _towarray > 0 ) then { tow = _vehicletow addAction ["Tow", "towing.sqf"]; }; Share this post Link to post Share on other sites