Granting royalties for first buyers

Is there a way to create a smart contract for the sale of an nft collection. The nfts have to pay royalties to the creator as well as the first buyer??