As yet, I have this:
begin myscriptactivatorshort doonceif ( doonce == 1 ) returnelse if ( GetDistance, Player < 512 ) set startrunning to 1 ;startrunning is a global variable set doonce to 1 endifendifend
and the script pinned to the running thief:
begin myrunningscriptshort stateif ( state == 0 ) if ( startrunning == 1 ) set state to 1 else return endifelseif ( state == 1 ) AiTravel, -13140, 21705, 1546, 0 ForceRun set state to 2elseif ( state == 2 ) if ( GetAIPackageDone == 1 ) set state to 3 endifelseif ( state == 3 ) AiTravel, -12911, 21052, 1568, 0 set state to 4elseif ( state == 4 ) if ( GetDistance, Player > 32 ) set state to 5 endifelseif ( state == 5 ) ForceGreetingelseif ( state == 6 ) AiTravel, -13518, 20432, 1561, 0 set state to 7elseif ( state == 7 ) if ( GetAIPackageDone == 1 ) AddSpell, "hideeffect" set state to 8 endifelseif ( state == 8 ) returnendifend
State number 6 is set via dialogue box.
Unfortunately, ForceGreeting executes when the thief gets state 3 and his/her greeting is relooping all the time.