rotation script for normal

So is there a way to setup a rotation script to have an object follow the normal of a polygon or vertex?