Lucas was involved in writing both sequels. He has the story credit on ESB (and it’s generally accepted he reworked a lot of Leigh Brackett’s original draft), and he has both story and screenplay credits on RotJ, the latter shared with Lawrence Kasdan.