How to disable item picking

I have an inventory and this is the item picking but i want to disable the boids movement and the object deleting action when all the inventory slots are full
I tried doing it this way and it stopped the boids movement and the object deleting but it also stopped the same object from picking