How to save player accessories

Hello, i need help making a script where i can save a player accessories. Ive seen alot of post where people have already started making the script. Ive made a post about this before and they person just wrote me a paragraph on what to do and i really didnt understand it. I have worked with saving value, but not accessories

I found this script from a really old post and i have no idea what it does or how it works. All i know is that when i leave the game and join back the accessories arent saved

local DataStoreService = game:GetService("DataStoreService")

game.Players.PlayerAdded:Connect(function(Player)
	local CurrentAccessories = Instance.new("Folder" , Player)
	CurrentAccessories.Name = "CurrentAccessories"

	for _ , v in pairs(CurrentAccessories:GetChildren()) do
		local DataStore = DataStoreService:GetDataStore(v.Name)
		local StringValue = Instance.new("StringValue" , Player:WaitForChild("CurrentAccessories"))
		StringValue.Value = DataStore:GetAsync(Player.UserId) or v.Name
	end
end)

game.Players.PlayerRemoving:Connect(function(Player)
	local CurrentAccessories = Player.CurrentAccessories

	for _ , v in pairs(CurrentAccessories:GetChildren()) do
		if v:IsA("StringValue") then
			local DataStore = DataStoreService:GetDataStore(v.Name)
			DataStore:SetAsync(Player.UserId , v.Value)
		end
	end
end)