How can I make something where after apon purchasing a Developer Product, a GUI Pops up

What does this do differently then the one I have already?

1 Like

Doesn’t wait 3.25 seconds after each purchase (it just checks if the player is valid) if they are then the purchase is granted, if they’re not then the purchase is regarded as unprocessed and the next time they join, the game will attempt to award whatever was purchased.

1 Like

The wait I added because I want it to wait 3.25 seconds before it purchases so it can match when the GUI opens when you purchase. And what do you mean by if the player is valid.

1 Like

If the player who bought the product still has their player object in the game. For example, say a user bought a product but accidentally left or disconnected before the purchase was awarded, now the game will note that purchase as unprocessed and will attempt to process it the next time they join.

1 Like

So if they’re just still inside the game?

MPService.PromptProductPurchaseFinished:Connect(function(UserId, ProductId, IsPurchased)
	if IsPurchased then
		StarterGui.ThankYouMessage.Visible = true
	end
end)

What is the product id for this?
and is “StarterGui” the StarterGui folder or is it a “ScreenGui”?

Oh, I already have that done, don’t worry about that! And also thanks, I appreciate your help!

I was going to add it to the ProcessReceipt.

This is the script for one of them (The Developer Product)

local MPService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer or Players.PlayerAdded:Wait()
local StarterGui = script.Parent.Parent.Parent.Parent.Parent.Parent
local ProductId = 1212048436 --change to developer product id

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(Player, ProductId)
	StarterGui.LoadingPurchase.Enabled = true
end)

MPService.PromptProductPurchaseFinished:Connect(function(UserId, ProductId, IsPurchased)
	if IsPurchased then
		StarterGui.RobuxShopMenu.Enabled = false
		StarterGui.ThankYouMessage.Frame.Visible = true
		wait(0.4)
		StarterGui.LoadingPurchase.Enabled = false
	elseif not IsPurchased then
		-- print("The user canceled the prompt")
		StarterGui.LoadingPurchase.Enabled = false
	end
end)
1 Like

Are you trying to add the ProcessRecipt?