What a coincidence, I also had to code the same mechanics for my own game (this might not be the most efficient way to do it, but it works)
Projectile hit event()
{
if(projectile name equals "something") //only if you want weapons with different behaviors
{
//All the fancy stuff...