I'm wanting to add a location to a key changer script to make it where the script will only execute within say 15 meters of an object, in this case the "worker4" ai (like a trader)
I'm thinking that it should go after the check for the player
if ((vehicle player) == player) then {
and be something along the lines of
If (player is within 15m of "worker4") then {
But I honestly don't know how to write it. Either that or I'd like to do the same check before the loop runs, and then turn off the loop after you exit the radius since right now it's constantly running the loop. I'm attaching a copy of the key changer script as well hopefully I can get this to work with some help