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

Developer Product doesn't show gui? [UNANSWERED!]

Hi guys! I have this dev product. It lets me purchase it and it takes my money but doesn't display the gui or change the value :( Any ideas? Thanks!

Script in button in the Workspace:

local MarketplaceService = game:GetService("MarketplaceService")
local productId = 19750967
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.PlayerGui.ChoosingMap.Frame.Visible = true
		game.Workspace.ChooseMap.Value = true
		
		end
	end
end	

return Enum.ProductPurchaseDecision.PurchaseGranted		

end

localscript in the starterpack:

local buyButton = game.Workspace.Choosemapbutton.SurfaceGui.TextButton
local productId = 19750967

buyButton.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)


1 answer

When using PromptProductPurchase() you need to give the required parameters which is the Player and the ProductId! For example:

local Players = game.Players.LocalPlayer
local buyButton = game.Workspace.Choosemapbutton.SurfaceGui.TextButton
local productId = 19750967

buyButton.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(Player, productId)
end)

If those two requirement haven't been met then it the function will return void. If you have any more more question then please feel free to post a comment below!

-UserOnly16Characters

1 comment

0

Thanks, but I dont see any different between mine and your code?! I defined the player in the brackets of the PromptProductPurchase in mine? :) I just don't it is displayed :/ There are no errors at all :/

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