Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
Did you copy and paste the script from the printable version of this thread? I've gotten the same problem from just grabbing it from the forum version of this thread.
FINAL EDIT: So I've tested and can confirm, that replacing all old terrain tags with the new updated tags will fix it.
Thanks for all the people who helped!
If anyone missed the fixes.