I'm sorry if this is a stupid question.
I'm adding in a gamepass shop in-game for this tycoon I am developing for, and the owner has asked me to make it so if they buy the gamepass in-game then they get what they paid for without having to leave and rejoin.
for i,v in ipairs(script.Parent:WaitForChild("Gamepasses"):GetChildren()) do
v:FindFirstChild("TextButton").MouseButton1Click:connect(function()
if v.Name == "TwentyFiveKCash" then
MarketplaceService:PromptPurchase(Player,TwentyFiveKPass)
Here is part of the code which prompts the user with a purchase. How would I determine whether or not the Player actually purchased the item?

2 comments
You could wait a couple of seconds and then see if the player has the pass by using the PlayerHasPass function
i think u can use PlayerOwnsAsset() for live results, idk, i think it might be better.