Array is not allowed in data stores. even though its a table

as you can see this is my table

image

and when i return the data to the data store

image

i get this

image

even though its a table i tried many ways like data[1] = “hello” , data = {yes = “hello”}

im not sure why its doing this any clue or is this a bug?

1 Like

Need to see more code and in actual code snips on the thread rather than pictures.

Are you by chance trying to use UpdateAsync on an OrderedDataStore? I feel like that would cause an error like this, though there might be a specific error that’s sent when you attempt to save a non-integer value to an OrderedDataStore.

1 Like

yes i am using it on a OrderedDataStore
here is all of the code

local function UpdateData(player)
	local tries = 0 
	local s , e 
	repeat
		tries += 1
		s, e = pcall(function()
			Ds:UpdateAsync(player.UserId,function(old)
				local data = {Wins = player.playerstats.Wins.Value , Level = player.leaderstats.Level.Value}
	
				if old == nil then
					return data
				end
				if old.Wins == player.playerstats.Wins.Value and old.Level == player.leaderstats.Level.Value then
					return nil
				else
					return data
				end
			end)
		end)
	until tries == 3 or s 
	if s then
		warn("SAVED")
	else
		warn("NOT SAVED -- ".. e)
	end
end
1 Like

Explains. You can’t save non-unsigned integers to OrderedDataStores. The only UpdateAsync that would work is if you return a number.

2 Likes

oh so im thinking now i would have to use 2 OrderedDataStores for 2 values im guessing?

You can. You can resolve this in pretty much any fashion you’d like, depending on your use case. I don’t typically recommend using two DataStores but for the sake of leaderboards, yes you would have to do something like that.

alright thanks for your help and info