The doctor tells everybody to just play along with Shaggy's amnesia. So now Shaggy thinks he's Commander Cool. When he finally gets his memory back he doesn't remember what just happened.