This script had no errors in the output. All I'm trying to do it make it so when you click the brick it prompts you to buy something.

local click_detector = Instance.new('ClickDetector', script.Parent)
local tool = game.ServerStorage.CandyBar
click_detector.MouseClick:connect(function(player)
 if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,172535092) then
	print("Has asset")
else
	print("Does not have asset")
	game:GetService("MarketplaceService"):PromptProductPurchase(player, 172535092, false, Robux)
end
end)

3 comments

0

Use PromptPurchase; Only use PromptProductPurchase for dev products; PromptPurchase is for assets..

0

Still not working ^

0

Never mind I had two click detectors in their.... it's fixed