Datastore and Dictionary's

I am developing a game that includes every player to have an inventory. I want to save all of the items to one datastore rather than a datastore for each item. Each item has a bool value inside the Player which basically says if the player has that item the bool is true. Saving the dictionary worked but I don’t know how to compare it or test if it changed so I could update the bool for the item. How would I go about this?

Here is an image of what I am trying to accomplish if you’re confused:

This is my code I tested out to save a dictionary to a datastore (Provided by Mew):

local datastore = game:GetService('DataStoreService'):GetDataStore('Arrows', '771417')

local myArrows = { ArrowA = true, ArrowB = true, ArrowC = false }

datastore:SetAsync('test', myArrows)

wait(7)

local test = datastore:GetAsync('test')

print(test)

In my opinion, the best way is to use a script instead of BoolValues for storage.

local Unlocked = {
    Sword = true,
    Pistol = true,
    FingerGunOfMolecularDeconstruction = false
}

And any time the script needs to update one of those, you will already know since you scripted it. Likewise, if you did intend on continuing to use BoolValues, you can save whenever you change the values since you will have had them scripted to change anyways. Or, if you want, you can use Changed.

BoolValue.Changed:Connect(function(newValue)
    save(newValue)
end