Help with Item and Inventory System

Godot Version

4.2.2

Question

I’m newer to Godot and I don’t know much about 3D my problem is probably really simple but I’m just stupid.
I was following a tutorial and I messed up my code a bit and now my items won’t destroy when I pick them up. Someone please help. Heres some of my code

#inventory_manager.gd
extends Node


const INVENTORY_SIZE = 28

var inventory : Array = []

func _enter_tree() -> void:
	EventSystem.INV_try_to_pickup_item.connect(try_to_pickup_item)

func _ready() -> void:
	inventory.resize(INVENTORY_SIZE)

func try_to_pickup_item(item_key: ItemConfig.Keys, destroy_pickuppable: Callable) -> void:
	if not get_free_slots():
		return
		
	add_item(item_key)
	destroy_pickuppable.call()

func get_free_slots() -> int:
	return inventory.count(null)

func add_item(item_key : ItemConfig.Keys) -> void:
	for i in inventory.size():
		if inventory[i] == null:
			inventory[i] = item_key
			return

pickuppable.gd:

@onready var parent : Node3D = get_parent()

func start_interaction() -> void:
	EventSystem.INV_try_to_pickup_item.emit(item_key, destroy_self)


func destroy_self() -> void:
	parent.queue_free()
	

important to link the tutorial you are watching, else we will decipher from your code alone

the reason it’s not destroying is because of this 2 lines
in your get_free_slots function, you are returning how many null count in the inventory
but instead of checking how many inventory count left, you just use not from it
applying not to int, i never done that before, but this line looks like the culprit

I do not see start_interaction being called anywhere.
If it is a signal please check if it is connected.