
Below is a swarm script that was originally posted by Apotheus Silverman in the Script Library forum. It may have been deleted in one of the forum updates, so I'll post it here. It handles basic swarming in the air and water. It is well commented and should make it possible to modify to include other behaviors.
Edited: Just go to the link below. It has an updated version that includes schooling