Script for type swap