What I'd do is to overwrite the tool collision function and make a raycast fire every time the player activates. If the raycast hits an item, check the length of the raycast or the distance of the player to the brick. If it's in the allowed range, addItem(); Otherwise, return.