So I'm making a point system for ranks ups and such so I made a dictionary to try and make it all organized but I can't figure how out to go forwards and backwards on the list. What I mean is something like this **(RankData[2]) ** so it gets the string/value second from the top, I have this so far.
local CurrentRank = "Premium Customer"
local LastRank = nil
local RankData = {
["Premium Customer"] = 40,
["VIP Customer"] = 60,
["Noted Customer"] = 100,
["Tainee"] = 130,
["Customer Service"] = 170,
["Attendant"] = 220,
["Senior Attendant"] = 280,
["Host/Hostess"] = 350,
["Supervisor"] = 440,
["Interview Managment"] = 550,
["Board of Directors"] = 680,
["Chairman of the Board"] = 800,
["Chief Operational Officer"] = 1500,
["Chief Executive Officer"] = 2000,
["Vice President"] = 3000,
["President"] = 5000,
["Vice Chairman"] = 7000,
}
--print(RankData[1]["Premium Customer"])
--local nums = (unpack(RankData))
for i,v in pairs (RankData) do
print("Current Rank is " .. CurrentRank)
print("Next rank will be " .. RankData['Premium Customer'])
LastRank = CurrentRank
---HOW can I go back, or forward like
---(RankData[2]) so it does to the second item on the list which would be "VIP Customer"
end

5 comments
i may be wrong but you can't use numbers when the table uses strings. try (RankData["Premium Customer"]) that should give you 40
I know how to do that, I just wanted to know if I could do the (RankData[2]) so I can transition from one rank to the other without knowing the name so that it becomes easy to add onto/edit
no you cant do that. what you would need to do is use a folder and have stringvalues in them with the ranks as the value and the number as the name and use :FindFirstChild()
Aw okay :( I'll do that Thanks
np. just a hint you will need to put a letter before the number. you can do that by separating the 2 like this: .Name="A" .. Variable