#how can I get the position of a player / key in an ordered data store
1 messages · Page 1 of 1 (latest)
dont you just call GetAsync? i dont really understand the question
@mint lynx give context
no i mean like the position of the key
if i call GetAsync I just get the value of the key
Im trying to make a thing where it shows which one were you to get the badge or something
I think you want OrderedDataStore
did you read the title per chance
Lol guess I didn't
What do you mean order though? What part of the OrderedDataStore isn't working for you?
Key value pairs don't really have anything other than keys and values
You have a key and an integer value, not much else there for you
I want to get the position at which the key is so i can display it
Its hard to explain
Its like there is 1000 people who got a badge and someone got it at 576 place
I want to display to them only that they got it at 576th place
Something like this (from a different game)
probably store the next place separately for o(0) search then either table or orderedstore
lots of ways ;o
I think just use an index variable then iterate over all keys in the data store and if the key has the badge then increment the index variable and then when done append it to the player's own data table as their "place"
storing the next-index eliminates need to iterate over all keys in the datastore, which can spend a tonne of quota even all of it particularly in the 1000's
and since they don't really need to be ordered, it's that easy 👍
you only need to know which id is next