Buying a UGC doesn't work in game

Hi,

I’m creating a Roblox game in which you will be able to claim a UGC item by completing a challenge.

However, when you finish the challenge, purchasing the item doesn’t work.
image
This error shows when you try to purchase it.

I am really frustrated about this as we had to close down the game shortly after launch because of this bug.

Script:

local id = 15603753219
local mps = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	if plr:WaitForChild("leaderstats"):WaitForChild("Wins").Value >= 10 then
		mps:PromptPurchase(plr, id)
	end
end)

This script is inside of an ImageButton btw.

2 Likes

Make sure you have this enable

I have everything except third party teleports

All PromptPurchase calls prompting to purchase Limited items such as UGCs must be done on the server or the prompt will fail.

Thanks! I just saw that right now and tested it, and it turned out to work. Ty for your help!

I would suggest you to go into your game settings and turning on Third Party Sales.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.