When two props touch (Gamemode) HELP

I am looking for a way to make it when two props touch each other, or collide, a new prop is made. I was thinking it was a hook of some sort and could be put into the init.lua file as a function but… apparently not.

Just to give you something to work with, let’s say… The two props I’d like to touch are of models “models/props_c17/metalPot001a.mdl” and “models/props_junk/watermelon01.mdl” and the prop I’d like to be created would be “models/props_c17/doll01.mdl” after removing the Pot and the Melon.

Melon + Pot = Baby. Simple logic.

Thanks in advance to whoever may help me with this. I’ve seen this kind of stuff before I just don’t know how they did it. If there’s some different method of doing this, like creating a hammer SWEP and making it so you had to hit a prop to get something (Much easier, I’d assume) and you’d rather explain that, that will work too. Thanks again!

So, in the future can I tell my children they were made when I put a pot and a melon together?

Also I apologize, but I have no idea. I would assume that you would run a check to see if there is a collision for certain props or any at all, I’m sure there is a check out there for it. Then you just spawn a prop if that is the case. If not then again I apologize.

Well you could make the pot a entity and use ENT:Touch

There’s a hook for collisions.

"Additional Notes

The entities in passed to this hook will not necessarily collide, so this hook is not a reliable collision check."

It might be easier to check the distance between the props, and see if they are close enough to “collide”. <-- don’t do this, its a bad idea!

My friend used what J.R. said.
Here is a wiki link.