Problems with storing arrays in Datastore

Greetings, developers! I am making a game where inventories are involved. I keep the inventory within a LocalScript as an array, in this format: (keep in mind the names aren’t what are actually there)

local inventory = {

    {game.ReplicatedStorage.Placeables["item1"], 0},

    {game.ReplicatedStorage.Placeables["item2"], 0},

    {game.ReplicatedStorage.Placeables["item3"], 0},

    {game.ReplicatedStorage.Placeables["item4"], 0},

    {game.ReplicatedStorage.Placeables["item5"], 0},

    {game.ReplicatedStorage.Placeables["item6"], 0},

    {game.ReplicatedStorage.Placeables["item7"], 0}


Also, the number represents the quantity of that item. When sent to the server (via RemoteEvent) for use in the Datastore, it failed to save, so I attempted a different method, because the fact that actual in-game items were in use within the array I decided to run a loop that basically converted it to just the names, like this:

local inventory = {

    {"item1", 0},

    {"item2", 0},

    {"item3", 0},

    {"item4", 0},

    {"item5", 0},

    {"item6", 0},

    {"item7", 0}


I also tried using HttpService:JSONEncode() and HttpService:JSONDecode() to see if tables were even savable. But I found out that they must’ve been when I set my Datastore to a table using the DataStore Editor by sleitnick, because it loaded fine after I added a loop to wait until said table was loaded and sent to the client. I’m stumped. I’ve been trying for a few days and decided to come here for help. Help is very appreciated!

Tables are fine, but Instances are not

This wouldn’t work, you should try saving the item name

If you read on, I did say that I ended up using the item name.

Then could you show the part where you save it? The table seems fine to me. There could be something going wrong when you actually save the data.

Alright. This is a Script (server-sided) in ServerScriptService:

	print("Attempting to save "..player.Name.."'s data")
	money:SetAsync(player.UserId, player.Money.Value)

Right there is not the only time when it saves, but the function is the same. It fires an event within a LocalScript, the same one that the table is stored in:

	local sendOff = inventory
	for i,v in ipairs(sendOff) do
		v[1] = v[1].Name
	selected = inventory

This sends the table with the strings back to the server to save, which is handled here:

    inventory:SetAsync(plr.UserId, inv)