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

how can i make a gui pop up right after a player buys a gamepass?

so i made a couple of game passes, and i want to make it so a gui that confirms the purchase of the gamepass to the player (if they buy it in-game), does anyone know what a script to make this work should be?

1 answer

✓ Accepted answer

#:PromptGamepassPurchaseFinished

It sounds kind of long for an event but it fires everytime a gamepasspurchase has been processed.

Here's the script

local gamepassId = "Your gamepass id"
local MSP = game:GetService("MarketplaceService")


MSP.PromptGamePassPurchaseFinished:Connect(function(player, purchaseid, purchasesucess)
	if purchaseid == gamepassId and purchasesucess == true then -- if the player purchased it, it's important to keep purchasesucess, becasue then it will fire even though its not purchased
		player:WaitForChild("PlayerGui").ScreenGui.Frame.Visible = true
		
		
	end
end)

Here's a link for more info; Here

3 comments

0

thank you!

0

i have one question though, where am i supposed to put the script?

0

Oh! Make a server-script, in serverscriptservice :)

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