While Loop Not Working Correctly In Pairs Function Scripting

While Loop Not Working Correctly In Pairs Function Scripting