There is one more thing I want you to try, change
if ( gethealth < 1 ) setfight nfight ; missing "to" setflee nflee setalarm nalarm set varclean to 1endif
begin RAK_tg_kidnappingshort chanceshort oppositionshort initialshort doonceshort currentdayshort varcleanshort oncedoshort threedayshort didonceshort pspeeshort pstrfloat nfightfloat nfleefloat nalarmif ( initial == 0 ) set nfight to ( getfight ) set nflee to ( getflee ) set nalarm to ( getalarm ) set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set opposition to ( ( getspeechcraft ) + random100 ) set pspee to ( "player"->getspeechcraft ) set pstr to ( "player"->getstrength ) set chance to ( pspee + pstr ) set initial to 1 returnendifif ( gethealth < 1 ) setfight nfight setflee nflee setalarm nalarm set varclean to 1endifif ( ( getpccell "Balmora, South Wall Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ba_ransom to 1 endifelseif ( ( getpccell "Ald-ruhn, The Rat In The Pot" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ar_ransom to 1 endifelseif ( ( getpccell "Sadrith Mora, Dirty Muriel's Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_sm_ransom to 1 endifelseif ( ( getpccell "Vivec, Simine Fralinie: Bookseller" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_vc_ransom to 1 endifendifif ( RAK_kidnap == 0 ) if ( opposition < chance ) set RAK_kidnap to 1 endifelseif ( RAK_kidnap == 1 ) if ( doonce == 0 ) aifollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set doonce to 1 return elseif ( doonce == 1 ) if ( ( getdistance "player" ) >= 500 ) set currentday to day set RAK_kidnap to 2 return endif endifelseif ( RAK_kidnap == 2 ) if ( oncedo == 0 ) AIWander 5000, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set oncedo to 1 return endif if ( currentday != day ) set currentday to day setfight nfight setflee nflee setalarm nalarm set varclean to 1 return endif setfight 70 setflee 40elseif ( RAK_kidnap == 3 ) set opposition to ( ( getspeechcraft ) + random100 ) if ( opposition < chance ) set doonce to 0 set RAK_kidnap to 1 return else moddisposition -30 set RAK_kidnap to 2 return endifelseif ( RAK_kidnap == 4 ) if ( didonce == 0 ) forcegreeting AIWander 500, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set didonce to 1 endif if ( currentday != day ) set currentday to day set threeday to ( threeday + 1 ) endifendifif ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 100 ) setfight nfight setflee nflee setalarm nalarm set RAK_kidnap to 5 set varclean to 1endifif ( varclean == 1 ) set RAK_kidnap to 0 set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set initial to 0 stopscript "RAK_tg_kidnapping"endifend
begin RAK_tg_kidnappingshort chanceshort oppositionshort initialshort doonceshort currentdayshort varcleanshort oncedoshort threedayshort didonceshort pspeeshort pstrfloat nfightfloat nfleefloat nalarmif ( initial == 0 ) set nfight to ( getfight ) set nflee to ( getflee ) set nalarm to ( getalarm ) set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set opposition to ( ( getspeechcraft ) + random100 ) set pspee to ( "player"->getspeechcraft ) set pstr to ( "player"->getstrength ) set chance to ( pspee + pstr ) set initial to 1 returnendifif ( gethealth < 1 ) setfight nfight setflee nflee setalarm nalarm set varclean to 1endifif ( ( getpccell "Balmora, South Wall Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ba_ransom to 1 endifelseif ( ( getpccell "Ald-ruhn, The Rat In The Pot" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ar_ransom to 1 endifelseif ( ( getpccell "Sadrith Mora, Dirty Muriel's Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_sm_ransom to 1 endifelseif ( ( getpccell "Vivec, Simine Fralinie: Bookseller" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_vc_ransom to 1 endifendifif ( RAK_kidnap == 0 ) if ( opposition < chance ) set RAK_kidnap to 1 endifelseif ( RAK_kidnap == 1 ) if ( doonce == 0 ) aifollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set doonce to 1 return elseif ( doonce == 1 ) if ( ( getdistance "player" ) >= 500 ) set currentday to day set RAK_kidnap to 2 return endif endifelseif ( RAK_kidnap == 2 ) if ( oncedo == 0 ) AIWander 5000, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set oncedo to 1 return endif if ( currentday != day ) set currentday to day setfight nfight setflee nflee setalarm nalarm set varclean to 1 return endif setfight 70 setflee 40elseif ( RAK_kidnap == 3 ) set opposition to ( ( getspeechcraft ) + random100 ) if ( opposition < chance ) set doonce to 0 set RAK_kidnap to 1 return else moddisposition -30 set RAK_kidnap to 2 return endifelseif ( RAK_kidnap == 4 ) if ( didonce == 0 ) forcegreeting AIWander 500, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set didonce to 1 endif if ( currentday != day ) set currentday to day set threeday to ( threeday + 1 ) endifendifif ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 100 ) setfight nfight setflee nflee setalarm nalarm set RAK_kidnap to 5 set varclean to 1endifif ( varclean == 1 ) set RAK_kidnap to 0 set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set initial to 0 stopscript "RAK_tg_kidnapping"endifend
aifollow player 0, 0, 0, 0instead.
if ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 100 ) setfight nfight setflee nflee setalarm nalarm set RAK_kidnap to 5 set varclean to 1 return ;<-------- need a return here to go back up to the NPC teleport, before the last If block runs (cleanup block with the stopscript)endif