Lol, don't listen to these guys if you are making something like a cross between a land mine and a C4.
OK, what you need to do (No scripting involved) is simply make it constantly shoot an invisible projectile about 3-6 feet or so in the air. If that projectile hits something, then make it detonate.
Simple and effective.

