Please format code properly when you post it, I would like to help but I can hardly tell what is going on here. Normally I would look at code formatted like this and just move on, but I might have noticed something that is an issue. I say might be because again, I cannot tell.
The second is statement seems to check if the rank is only equal to or greater than the last. What is it supposed to do if the rank is in the range of [1 #Rank)? Also when debugging “it’s not running” issues it help to either use break points in the debugger or put print statements to see where it stops printing. In particular, right before and after the WaitForChild calls seems like a likely place to cause an issue. Particularly if the “PoliceRank” stat was actually “Police Rank” or something like that.
It’s worth noting that a list of strings as you suggested is stored in the array section, not the dictionary. His code will work the exact same either with the '[x] = ’ or without them. (note that this only works when x is a number, starts at 1, is continuous with a step size of 1, and ordered from least to greatest).