I'm guessing it may be related to how you
return out of the whole function when you encounter someone of high rank, instead of just skipping the processing on that particular loop iteration. For example, instead of:
Code:
if rank == 1 or rank == 2 or rank == 3 then
return
end
-- do stuff
try doing:
Code:
if rank > 3 then
-- do stuff
end
inside your loop, so that encountering a high rank doesn't stop all further processing.