How do I make a clickdetector part show the purchase premium prompt?

So I have this buy button that has a clickdetector inside where if you click it I want it to show the purchase roblox premium prompt for the player that clicked it only (if you don’t own premium), but if you own premium it will show/do nothing. How do I make that work? I tried searching the wiki PromptPremiumPurchase but I didn’t really understand what to do.

Picture to explain:
Screenshot_3

Please explain thoroughly as I am not a very good scripter.

Put this script in the ClickDetector

local MarketplaceService = game:GetService("MarketplaceService")

script.Parent.MouseClick:Connect(function(player)

MarketplaceService:PromptPremiumPurchase(player)

end)
1 Like

It’s working perfectly, thank you so much!!!

1 Like