Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Developer Product Script not working?

So, I am creating a game, sorta like Cookie Clicker. This is a script I used for buying clicks with developer products. I don't know if it's the problem or not, but I am not BC

Since I can't load developer products in test, I can't figure out what the problem is. Please tell me what the problem is and fix my mistake.

local productId = 22069922
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

MarketplaceService.ProcessReceipt = function(receiptInfo) 
	for i, player in ipairs(game.Players:GetChildren()) do
		if player.userId == receiptInfo.PlayerId then
			if receiptInfo.ProductId == productId then
				player.leaderstats.Clicks.Value = player.leaderstats.Clicks.Value + 500
			end
		end
	end

2 answers

What does the output say? (sorry this is meant to be a comment but I'm stupid and couldn't find the comment button (It doesn't allow you to do it for the asker))

1 comment

0

"Since I can't load developer products in test, I can't figure out what the problem is. "

Looking at that error message, maybe you should try to run the place as a server, and check if it works outside of the studio testing mode.

This discussion is preserved as it was. New answers, comments, and votes are closed.