Does anyone have/know how to create a foliage script?

Does anyone have/know how to create a foliage script like seen in the video below?

Not sure if this is the right category

They are most likely rotating the unions that have the surfaceAppearance on them to make them appear to be moving. Just pick a semi-random direction for them to go back and forth along and it would look similar

use the WindShake module ( High performance wind effect for leaves and foliage )