So since the new roblox update with the gamepass I have no idea how to do this any ideas? on how to make a part have a script and when someone clicks on it will let them buy the gamepass?
You need use.
SurfaceGUI. ClickDetector. LocalScript
and MarketplaceService
Assuming your game has "Filtering Enabled" enabled, you need to use Remote Events in conjunction with a Click Detector on the part that you want to be clicked. If your game does not have "Filtering Enabled" enabled, then you don't need to use Remote Events and just detect a click in a Local Script.
Once you got a click detected, follow this which will teach you how to prompt game pass purchases and make game passes function.