Help With Arrows

Hi, I've needed to make a arrow that when it hits an entity, it sets them on fire, or summons a lightning bolt. I know how to summon lightning bolts and stuff, but i need a way to detect when the arrow hits an entity, and runs the function at the entity that was shot. Im also wanting to make several custom arrows, so I want to filter the arrow by the item model. You'd think this should be very easy, but I've been at it all week and cant find a working solution. Any help would be very appreciated!
Continue to help post