Help with select key item

So, i'm using select key item for some of my events and if I was wondering if there was a way to make it so the key item you select disappears from your inventory.

For example, I'm using a gift system, so I want the selected gift to disappear from your inventory when you give it. I could use conditional branches for each item, but I think that would be too long to do.
If you use Variable 1 in your Select Key Item command, do the following in a Script event:

Code:
$game_party.lose_item($data_items[$game_variables[1]],1)
If you have an older version of the engine that doesn't have a wide script box, and the above is too much to fit on a single line, make it break like this:
Code:
$game_party.lose_item($data_items[$game_variables[1]],1)
@Shaz

Thanks! It works now.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-select-key-item.38606/