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

I am confused on Developer Products?

Please Help me with this I am confused?

-- Put the ID of the DevProduct in place of 19184765
local bloxyColaId = 19184765

-- When a player clicks on the sphere, they will be asked if they wish to purchase the DevProduct
script.Parent.ClickDetector.MouseClick:connect(function(player)
	Game:GetService("MarketplaceService"):PromptProductPurchase(player, bloxyColaId)
end)
-- define function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo) 

	-- find the player based on the PlayerId in receiptInfo
	for i, player in ipairs(game.Players:GetChildren()) do
		end
	end
		if player.userId == receiptInfo.PlayerId then
			
			
			if receiptInfo.ProductId == productId then
				Player.leaderstats.Money.Value = Player.leaderstats.Money.Value + 100
				end
			end

This will not work I am trying to give a player 100 Money if bought the developer Product but when I click the brick it will not pop out a buy item note? Please Help me?

3 comments

0

Is this in a LocalScript or regular script?

0

Regular Script

0

You have to put YOUR DevProduct's ID in place of the number there. You can't buy DevProducts from other Games. Also, it looks like some ends may be missing. Are you getting any Output from this?

1 answer

For ProcessReceipt to work correctly, you need to put the script in ServerScriptService.

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