GreatKeeper 0 Posted March 20, 2017 { if (vehicle player == player) && (typeOf cursorTarget) == vehicle; then { _x addAction ["<t color=""#0000FF"">Tow</t>", {hint "test"};, "", 6, false, false, "", "_this distance cursorTarget < 3"]; }; } forEach vehicles; ^^^^ Trying to get the above to do my hint "test" when the player is in any vehicle and looking at another vehicle that happens to be less that 3m away. I am execVM'ing the script. Unfortunately I can't seem to get it to work so does anyone mind showing me a working way or pointing out any errors, much appreciated! Of course I will replace the hint "test" with an attachTo script but that's not what I need help with :) Share this post Link to post Share on other sites
Nikander 122 Posted March 20, 2017 (edited) For one thing, you have an erroneous semicolon after your addAction codeblock {hint "test"} Try the following to see if it works for you { _x addAction ["<t color=""0000FF"">Tow</t>", {hint "test"}, "", 6, false, false, "", "_this distance _target < 10 && vehicle _this != _this && _target isKindOf ""LandVehicle"""]; } forEach vehicles Edited March 20, 2017 by Nikander addAction distance Share this post Link to post Share on other sites
killzone_kid 1326 Posted March 20, 2017 if is missing () and has not needed ; Share this post Link to post Share on other sites
GreatKeeper 0 Posted March 20, 2017 @killzone_kid Hey, I have removed the ; but where should I put the brackets you are suggestion? @Nikander Sorry that didn't work :( Share this post Link to post Share on other sites
killzone_kid 1326 Posted March 20, 2017 after if and before then, only it will still not work as typeof cursortarget will never == vehicle and you cannot compare string with object and vehicle needs an argument. I suggest you check other peoples code or use some examples from wiki Share this post Link to post Share on other sites