Cider inventory not updating weapons?

My gamemode’s inventory doesn’t fully update the weapons when they drop. Yes, it is based off of cider. No, I am not looking for your opinion about cider or roleplaying gamemodes.

The item drops and can be used and all, but the inventory keeps the item in there. The weird part is that when you try to use the item again it doesn’t let you it says you don’t have it.

Here is the code of the part in question. I included the destroy part because that option gets rid of it in your menu, but deletes all of the item and drop should get rid of only one.

[lua] function cider.item.drop(player, item, position)

	if (player.cider._Inventory[item] and player.cider._Inventory[item] > 0) then

		if (cider.item.stored[item]) then

			if (!position) then

				position = player:GetEyeTrace().HitPos

				

				-- Set the z position of the vector to be 32 units higher.

				position.z = position.z + 16;

			end;

			

			-- Check to see if we have an on drop function.

			if (cider.item.stored[item].onDrop) then

				if ( cider.item.stored[item]:onDrop(player, position) == false ) then return false; end;

				

				-- Update the player's inventory.

				cider.inventory.update(player, item, -1);

				

				-- Make the item at that position.

				cider.item.make(item, position)

				

				-- Return true because we did it successfully.

				return true;

			end;

		end;

	end;

	

	-- Return false because we failed somewhere.

	return false;

end;



-- Destroys a player's item.

function cider.item.destroy(player, item)

	if (player.cider._Inventory[item] and player.cider._Inventory[item] > 0) then

		if (cider.item.stored[item]) then

			if (cider.item.stored[item].onDestroy) then

				if ( cider.item.stored[item]:onDestroy(player) == false ) then

					return false;

				end;

				

				-- Update the player's inventory.

				cider.inventory.update(player, item, -player.cider._Inventory[item]);

				

				-- Return true because we did it successfully.

				return true;

			end;

		end;

	end;

	

	-- Return false because we failed somewhere.

	return false;

end;[/lua]

First; Holy shit, hello Mr. White space.
Second; The use function isent there
Third; If you want the destroy function to only delete a special amount, you need args in the function.
Fourth; “Drop” does drop one, as far as I know.

I must have been half asleep typing that what I meant is when you drop an item it will not update in the inventory, well not visually update I could send pics if that would help.

(sorry for this bump I was on vacation)


-- Drops an item from a player.
	function cider.item.drop(player, item, position)
		if (player.cider._Inventory[item] and player.cider._Inventory[item] > 0) then
			if (cider.item.stored[item]) then
				if (!position) then
					position = player:GetEyeTrace().HitPos
					
					-- Set the z position of the vector to be 32 units higher.
					position.z = position.z + 16;
				end;
				
				-- Check to see if we have an on drop function.
				if (cider.item.stored[item].onDrop) then
					if ( cider.item.stored[item]:onDrop(player, position) == false ) then return false; end;
					
					-- Update the player's inventory.
					cider.inventory.update(player, item, -1);
					
					-- Make the item at that position.
					cider.item.make(item, position)
					
					-- Return true because we did it successfully.
					return true;
				end;
			end;
		end;
		
		-- Return false because we failed somewhere.
		return false;
	end;