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?
✓ ANSWER ACCEPTED
how can i make a gui pop up right after a player buys a gamepass?
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
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
thank you!
i have one question though, where am i supposed to put the script?
Oh! Make a server-script, in serverscriptservice :)