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)
local MarketPlaceService = game:GetService("MarketplaceService") local productId = 1333302500 -- Id local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() MarketPlaceService:PromptProductPurchase(player, productId) MarketPlaceService.PromptPurchaseFinished:Connect(function(p, id, purchased) if purchased then delay(6, function() --It's the same as wait() :D script.Parent.Parent.Parent.Parent.Special.Thankyoucommand.Visible = false end) script.Parent.Parent.Parent.Parent.Special.Thankyoucommand.Visible = true script.Parent.Parent.Parent.Parent.Special.Thankyoucommand.Text = "Thank you for your purchase: " ..player.Name end end) end)