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)