This item save not working

everytime i quit the game it print saved but when i join nothing saved . i dont see any error in the script
, can anyone tell me what is wrong? (I learned this from Alvin blox)

here is the item save script

local DataStoreService = game:GetService("DataStoreService")
local invenData = DataStoreService:GetDataStore("saveInven")
local ServerStorage = game:GetService("ServerStorage")

game.Players.PlayerAdded:Connect(function(Player)
	local DataFolder = Instance.new("Folder")
	DataFolder.Name = Player.Name
	
	local inventory = Instance.new("Folder")
	inventory.Name = "Inventory"
	inventory.Parent = DataFolder
	
	local backpack = Instance.new("Folder")
	backpack.Name = "Backpack"
	backpack.Parent = inventory
	
	local equippedBackpack = Instance.new("StringValue")
	equippedBackpack.Name = "EquippedBackpack"
	equippedBackpack.Parent = inventory 
	
	DataFolder.Parent = ServerStorage.PlayersData
	
	local backpackData
	local equippedBackpackData
	
	pcall(function()
		backpackData = invenData:GetAsync(Player.UserId.."-Backpacks")
	end)
	
	pcall(function()
		equippedBackpackData = invenData:GetAsync(Player.UserId.."-EquippedBackpackValue")
	end)
	
	if backpackData then
		
		for _,Backpack in pairs(backpackData) do
			if ServerStorage.Backpacks:FindFirstChild(Backpack) then
				local backpackClone = ServerStorage.Backpacks[Backpack]:Clone()
				backpackClone.Parent = backpack
				print(Backpack.." loaded in!")
			end
		end
		
		if equippedBackpackData then
			equippedBackpack.Value = equippedBackpackData
			local backpackClone = backpack:FindFirstChild(equippedBackpackData)
			backpackClone.Name = "Backpack"
			backpackClone.Parent = Player.Character
		end
	else
		print("No backpacks data")
		local starterbackpack = ServerStorage.Backpacks["Starter Backpack"]:Clone()
		starterbackpack.Name = "Backpack"
		starterbackpack.Parent = Player.Character
		local itemValue = Instance.new("ObjectValue")
		itemValue.Name = "Starter Backpack"
		itemValue.Parent = backpack
	end
end)

game.Players.PlayerRemoving:Connect(function(Player)
	
	pcall(function()
		local backpacks = ServerStorage.PlayersData[Player.Name].Inventory.Backpacks:GetChildren()
		local backpacksTable = {}
		
		for _,v in pairs(backpacks) do
			table.insert(backpacksTable,v.Name)
		end
		
		invenData:SetAsync(Player.UserId.."-Backpacks",backpacksTable)
		
		if ServerStorage.PlayersData[Player.name].Inventory.EquippedBackpack.Value ~= nil then
			local EquippedBackpack = ServerStorage.PlayersData[Player.Name].Inventory.EquippedBackpack
			invenData:SetAsync(Player.UserId.."-EquippedBackpackValue",EquippedBackpack.Value)
		end	
	end)
	
	print("Saved backpacks")
end)

Since everything is wrapped in a pcall, even if there is an error, it will not print.

so why the item will not save then?

Try removing the pcall wrappers and seeing the error it prints out.

it only saved the EquippedItem the backpack wont be save

If your testing it in Studio, try turning on Studio access to HTTP and API under settings.

This is a quote from the Dev hub article about datastores:

If desired, data stores can be enabled in Studio as follows:

  1. From the Home tab, open the Game Settings window.
  2. In the Options section, turn on Enable Studio Access to API Services .
  3. Click Save to register your changes

Also, you can’t save Instances to a datastore.

i turned on already and where did i save instant

Try running it, but removing the pcalls so if there is an error, you can see what it is.