It just stops printing. I haven’t seen a nil in the print statements.
The gist of the getTarget() function is that it loops through a folder in the workspace that contains all the character models. Then it finds the character with the shortest distance to the humanoid.