Hi i am trying to setup a basic script that will detect if there are x amount of whatever item on ground and if there is then pick it up otherwise it would just ignore it, how would i go about doing this i've tried the following but it doesn't seem to be working thanks.
 
GroundItem item1 = groundItems.closest(id);
			if (item1.getAmount() >= 28) {
				item1.interact("Take");
			}