Gane items, own token

I have a complicated question, I have my game Nfts, but I want them to be able to be bought with my token, not with matic… That people have to buy my token to buy my game items… How do I make that contract… Starting from the example of the Nft market moralis clone… Thank you

A user has first to call approve for those tokens to be used by the smart contract address, and then in the smart contract you can transfer those tokens after the approve was done. It will imply two transactions, one for approve and one for buy