How would i go about saving weapons data? Equipped/Unequipped

So I am struggle to understand how to save weapons data like weapons damage.

local Save_Table_Data = {
      ["EquippedWeapon"] = Defualt,
      ["Damage"] = 10,
}

Someone sent me this and I’m not quite sure how this works and where would I have this, in a datastore script? and how would it save Datastore:SetAsync(key, Save_Table_Data) . Not sure, I really want to learn datastore as its essential to making a good game, and also minimum loss of data.

Do a search on https://developer.roblox.com/ and you’ll find helpful information on how to use DataStores. The data that someone sent you is likely supposed to be converted to JSON before going into the DataStore. JSON lets you convert a table into a string, and then you can take that string and save it in the DataStore to be retrieved later.

I made a datastore, and for some reason it doesn’t save. I am using datastore2.

local data = {}

local HttpService = game:GetService("HttpService")
local players = game:GetService("Players")
                                           
local Datastore2 = require(script.Parent.DataStore2) -- Get datastore2 module -- 1936396537
Datastore2.Combine("Inventory", "Gold", "Armour", "Potions", "Weapons","Health","Damage","MagicDamage","Level", "Experience","MaxExperience")

data.AddedEvent = function(player)
	
	--// Inventory System
	local Inventory = Instance.new("Folder", player); Inventory.Name = "Inventory"
	local playerGold = Instance.new("IntValue", Inventory); playerGold.Name = "Gold"
    local playerArmour = Instance.new("StringValue", Inventory); playerArmour .Name = "Armour"
    local playerPotions = Instance.new("StringValue", Inventory); playerPotions .Name = "Potions"
	local playerWeapons = Instance.new("StringValue", Inventory); playerWeapons .Name = "Weapons"
	
	--// Player Stats
	local playerHealth = Instance.new("IntValue", Inventory); playerHealth.Name = "Health"; playerHealth.Value = 100
	local playerDamage = Instance.new("IntValue", Inventory); playerDamage.Name = "Damage"
	local playerMagicDmg = Instance.new("IntValue", Inventory); playerMagicDmg.Name = "MagicDamage"
	
	--// Players Level
	local LevelSystem = Instance.new("Folder", player); LevelSystem.Name = "LevelSystem"
	local PlayerLevel = Instance.new("IntValue", LevelSystem); PlayerLevel.Name = "Level"; PlayerLevel.Value = 1
	local PlayerXp = Instance.new("IntValue", LevelSystem); PlayerXp.Name = "Experience"
	local PlayerMaxXp = Instance.new("IntValue", LevelSystem); PlayerMaxXp.Name = "MaxExperience" 
	
	--// Datastore 
    local goldStore = Datastore2("Gold", player); local goldStoreData = goldStore:Get()
    local armourStore = Datastore2("Armour", player); local armourStoreData = armourStore:Get({ })
    local potionsStore = Datastore2("Potions", player); local potionsStoreData = potionsStore:Get({ })
	local weaponsStore= Datastore2("Weapons", player); local weaponsStoreData = weaponsStore:Get({ })
	local healthStore = Datastore2("Health", player); local healthStoreData = healthStore:Get()
	local damageStore = Datastore2("Damage", player); local damageStoreData = damageStore:Get()
	local magicStore = Datastore2("MagicDamage", player); local magicStoreData = magicStore:Get()
	local levelStore = Datastore2("Level", player); local levelStoreData = levelStore:Get()
	local xpStore = Datastore2("Experience", player); local XpStoreData = xpStore:Get()
	local maxxpStore = Datastore2("MaxExperience",player); local MaxXpStoreData = maxxpStore:Get()
	
	--// JSON Encode/Decode 
    playerArmour.Value = HttpService:JSONEncode(armourStoreData) 
   		armourStore:OnUpdate(function(decodedData)
        playerArmour.Value = HttpService:JSONEncode(decodedData) -- Encodes newly updated data
	end)

    playerPotions.Value = HttpService:JSONEncode(potionsStoreData) 
   		 potionsStore:OnUpdate(function(decodedData)
         playerPotions.Value = HttpService:JSONEncode(decodedData) -- Encodes newly updated data
	end)
	
    playerWeapons.Value = HttpService:JSONEncode(weaponsStoreData) 
    	weaponsStore:OnUpdate(function(decodedData)
        playerWeapons.Value = HttpService:JSONEncode(decodedData) -- Encodes newly updated data
	end)
	
	
end

return data