Begin PatrolScript; Attached to patrolling NPCshort stateSetHello 0 ; prevent idle greetings as player approachesif ( state == 0 ) SetHello 0 ; prevents idle greetings as player approaches set state to 10 AITravel x1 y1 z1 ; coordinates of one endelseif ( state == 10 ) if ( GetAIPackageDone == 1 ) ; arrived at end of patrol set state to 20 endifelseif ( state == 20 ) set state to 30 AITravel x2 y2 z2 ; coordinates of other endelseif ( state == 30 ) if ( GetAIPackageDone == 1 ) ; arrived at other end of patrol set state to 0 endifendifEnd
Begin PatrolScript; Attached to patrolling NPCshort stateSetHello 0 ; prevent idle greetings as player approachesif ( state == 0 ) SetHello 0 ; prevents idle greetings as player approaches set state to 10 AITravel x1 y1 z1 ; coordinates of one endelseif ( state == 10 ) if ( GetAIPackageDone == 1 ) ; arrived at end of patrol set state to 20 endifelseif ( state == 20 ) set state to 30 AITravel x2 y2 z2 ; coordinates of other endelseif ( state == 30 ) if ( GetAIPackageDone == 1 ) ; arrived at other end of patrol set state to 0 endifendifEnd