How do I make script do something after a purchase is complete?

I want the script to do “game.StarterGui.Shop.Enabled = false” after a game pass purchase is complete but i am not sure how to do it
I tried but i keep failing

Depends what kind of a purchase you’re making. These events are available under the MarketplaceService as PromptXPurchaseFinished. For game passes, it’d be PromptGamePassPurchaseFinished.

2 Likes

I used PromptGamePassPurchaseFinished but it didn’t work.

Would you mind posting the code you have that incorporates that event? I’d like to see if it’s a problem with your implementation or if the event is acting up again.

1 Like

You have to handle PromptGamePassPurchaseFinished on the server then fire a remote function / event to the client which then runs the code

game.StarterGui.Shop.Enabled = false
1 Like