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

Hello! How can I make it when you purchase a Developer Product, such as a gamepass or a Developer Product, after you purchase the Developer Product (Gamepass, etc) It will pop up a GUI saying thanks for purchasing. How can I achieve this? I already have the thing for where it shows the Purchase Prompt, but I want something that after you buy from the Purchase Prompt that roblox gives you, and it will know when you purchase it will pop up a GUI saying thanks for puchasing

Example Video of what I mean:


(Purchase prompt shows up, after you press buy, it will know you bought it, then it will open the GUI, how can I achieve this?

Thanks! Any help will be appreciated! :grinning_face_with_smiling_eyes:

7 Likes

Can I please see your PromptProductPurchase Script?

2 Likes

local GamepassId = 00000000

script.Parent.MouseButton1Click:Connect(function()

game:GetService(“MarketplaceService”):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)

end)


(This is for the Gamepass)

2 Likes

Did you already make a thanks message GUI?

If so, whats the path?

1 Like

I think you could just use PromptGamePassPurchaseFinished, which fires when a prompt closes, either by purchasing or cancelling (which you can find with the parameter wasPurchased)
https://developer.roblox.com/en-us/api-reference/event/MarketplaceService/PromptGamePassPurchaseFinished

1 Like

Yes, I did, just put ThanksForBuying as an example name, and its in ScreenGUI

1 Like
local GamepassId = 00000000

script.Parent.MouseButton1Click:Connect(function()

game:GetService(“MarketplaceService”):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)

If success then


game.StarterGUI.ThankYouMessage.Visible = true
wait(3)

game.StarterGUI.ThankYouMessage.Visible = true
end

end)
2 Likes


??

1 Like
local GamepassId = 00000000

script.Parent.MouseButton1Click:Connect(function()

game:GetService(“MarketplaceService”):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)


game.StarterGUI.ThankYouMessage.Visible = true
wait(3)

game.StarterGUI.ThankYouMessage.Visible = false
end

end)
2 Likes

Check out the post above this one. I edited it.

1 Like


I am now getting this error

1 Like
local GamepassId = 00000000

script.Parent.MouseButton1Click:Connect(function()

game:GetService(“MarketplaceService”):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)


game.StarterGUI.ThankYouMessage.Visible = true
wait(3)

game.StarterGUI.ThankYouMessage.Visible = false
end)

end)
1 Like

By the way, I will have a Close button the GUI, so no need for the 3 second wait to close.

2 Likes

Alright. Then just make then get rid of the wait and the visible = false

1 Like

Alright, so would this be the script?

local GamepassId = 23359376

script.Parent.MouseButton1Click:Connect(function()

	game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)
	
	local StarerGUI = script.Parent.Parent.Parent.Parent.Parent.Parent
	
	game.StarterGUI.ThankYouMessage.Visible = true
end)

Also would I need to test this in-game?

2 Likes
local GamepassId = 23359376

script.Parent.MouseButton1Click:Connect(function()

	game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)
	
	local StarerGUI = script.Parent.Parent.Parent.Parent.Parent.Parent
	
	game.StarterGUI.ThankYouMessage.Visible = true
end)

Perfect. Try it and tell me if it works.

2 Likes


I seem to get this error

1 Like

Thats not me. You must have done the GUI path wrong

Edit: Change “StarterGUI” to

local StarterGUI = game.StarterGUI

StarterGUI.ThankYouMessage.Visible = true

1 Like

I don’t think I did the path wrong? It shows that everything is right

1 Like
local GamepassId = 23359376

script.Parent.MouseButton1Click:Connect(function()

	game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, GamepassId)
	
	local StarterGUI = script.Parent.Parent.Parent.Parent.Parent.Parent
	
	StarterGUI.ThankYouMessage.Visible = true
end)

The end result unless the path for making is visible is wrong.

1 Like