I was trying to script all objects in a DB and faced the same error on one of the tables. The solution that I had to follow as this:
1. In first run of "Generate Scripts" wizard, script all tables. Ran fine.
2. In second run, script all objects except tables.
Hope it helps.
-Akshay.