Inventory System not working. (Incrementing Attributes part not working)

Hello! I am creating an inventory system. However, it is not working.

game.Players.PlayerAdded:Connect(function(Player)
	local Inventory = Instance.new("Folder")
	Inventory.Parent = Player
	Inventory.Name = "Inventory"
	local BinaryStringValue = Instance.new("BinaryStringValue")
	BinaryStringValue.Parent = Player
	BinaryStringValue.Name = "InventoryData"
	BinaryStringValue:SetAttribute("MaxItems", 5)
	BinaryStringValue:SetAttribute("CurrentItems", 0)
end)

game.ReplicatedStorage.AddItemToQueue.Event:Connect(function(Player, Name, ImageId, PhysicalObject)
	if Player.InventoryData:GetAttribute("MaxItems") <= Player.InventoryData:GetAttribute("CurrentItems") then
		PhysicalObject.Parent = Player.Inventory
		Player.InventoryData:SetAttribute("CurrentItems", Player.InventoryData:GetAttribute("CurrentItems") + 1)
		game.ReplicatedStorage.ItemAdded:FireClient(Player, Name, ImageId)
	else
		game.ReplicatedStorage.DialogReplicated.SettingsServer:FireClient(Player, "Huh? My pockets are full. I cannot add ".. Name .." to my pockets.", nil, "", false, false)
		wait(5)
		game.ReplicatedStorage.DialogReplicated.CloseServerDialog:FireClient(Player)
	end
end)

The limit of temporary test number 5 is not working. What is not working is incrementing the attributes. I tried my little IncrementAttribute function, but it doesn’t work. If you can help, please let me know. Thanks! WE

How come you are using a BinaryStringValue?

Because its a square, and I use Attributes, and its a blank and light weight instance.

Found out I was using the RemoteEvent and not the function. Oops!