Context: There is a table like this
The indexes are the minimum level needed to achieve the rank, and the values in the table are tables with values inside themselves. A rank in this context is a string value which players can achieve as they progressively increase their levels.
ranklist = {
[1] = Beginner -- These are all tables found elsewhere in the script
[10] = Experienced
[21] = Master
[43] = Boss
}
I want to use this table in a way that with a given player's level, which is an integer value, I can extract the rank data tables.
In other words; Level 1 Player outputs the Beginner table; Level 9 Player outputs the Beginner table; Level 21 Player outputs the Master table; Level 25 Player outputs the Master table;

1 comment
Good approach! For clarity I think it can be a good idea to define the next node under the next key in a dictionary, and the value under a "value" key.