rapid movement back and forth

does any1 know how to make a child object move back and forth with a speed and frequency acroding to a fire rate?

I'm not sure what you want to do, but try to attach it to the bullet.