#Datastore Hell

24 messages · Page 1 of 1 (latest)

fresh marlin
#

My data rn is lookin like

#

Global/(UserId)
|
Version number can be 1-(number of times my data was saved)
|
Data
|
Wipe = false

kindred hamletBOT
#

studio** You are now Level 1! **studio

vocal meadow
#

highest galued key?

#

valued

fresh marlin
#

yes

vocal meadow
#

thats fairly easy to do

#

have a variable that is set to nil, loop through all the keys, if the key is higher then the variable then the variable is set to the key

#

also imo data stores are extremely simple

fresh marlin
#

when looping though all the keys what method should i use?

vocal meadow
#

for i, v

fresh marlin
#

i mean like

#

GetAsync etc

vocal meadow
#

do something like


local highestKey =
for i, v in pairs(keytable)
if highestKey then
if v > then highestKey then
highestKey = v
end
else
highestKey = v
end


#

then u get the highest key

#

how are your keys stored

fresh marlin
#

ill send a ss

vocal meadow
#

okay

fresh marlin
#

im away from my laptop but its a datastore with a buncha keys with number names that represent the version of the players data the lower the older

#

those keys have data stored in them

vocal meadow
#

huh

cloud frost
#

to get the highest valued you should use ordereddatastore

fresh marlin
fresh marlin