How can I use this script to be able to use sprites/flipbooks?

You could always create a particle system that has sprite/flipbook and set it to repeat at right timing and drop that into world.