Filtering based on a keyvalue?

I’m making a prop/machine thing that wants to detect what was prop put in it, and decide based on that what to give the player.

For example, if I activate the machine with nothing in it, nothing should happen. If I insert a watermelon and activate it, I want it to output a health pack. Tin cans would be made into random ammo, etc.

I can filter by names and classes, but I want to know iit is possible to filter based on a keyvalue? (in this example, the “worldmodel” keyvalue) Any links or comments would help.

You’ll have to go by object names unless you’re willing to consider some kind of LUA-based solution.

Ah, drag. It’s for a mod, so I guess lua is out of the question. I can make a workaround in hammer, just gonna have to make all the watermelons named “watermelon”. Thanks anyway.

Since it’s for a mod, why not get your coder to code a simple brush entity that triggers an output when it detects a certain model?

Because it’s a one-man mod and I know absolutely nothing about coding :v: