✓ Accepted answer
Arrays start counting from 0, so your username in the array is at position 0. For example, [A, B, C, D], A would be index 0, B index 1, C index 2 etc.
When you call players_allowed[1] you're calling the index after your username, which is undefined.
You could look up how to integrate over an array to make your code a bit cleaner :)
This isn't the best method but it's an ok example...
for index, player in ipairs(players_allowed) do //notice not curly brackets, also notice "ipairs" is used for arrays where as "pairs" is used for dictionaries (i stands for indexed)
if player == player_allowed[i] then//this will compare the username to every value in the list
print(player ... " Is an admin")
end
end
Apologies if I've missed something I haven't done pus in a while and I'm on mobile lol