Hi, I am having issues getting my Gui text to appear after a player purchases the product. What keeps happening is that as soon as the player clicks the button it comes up I want it to come up when the player has purchased the product. local script in Gui button:
local MarketPlaceService = game:GetService("MarketplaceService")
local productId = 1333302500 -- Id
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
MarketPlaceService:PromptProductPurchase(player, productId)
if Enum.ProductPurchaseDecision.PurchaseGranted then
script.Parent.Parent.Parent.Parent.Special.Thankyoucommand.Visible = true
script.Parent.Parent.Parent.Parent.Special.Thankyoucommand.Text = "Thank you for your purchase: " ..player.Name
wait(6)
script.Parent.Parent.Parent.Parent.Special.Thankyoucommand.Visible = false
end
end)

3 comments
on line 12 maybe try putting a repeat wait() until Enum.ProductPurchaseDecision.PurchasedGranted == true instead of the if loop?
alr i will try that thx
Sadly it didn't work