Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Close GUI with MarketPlaceService?

Asked by 6 years ago
Edited 6 years ago

I have this script that will prompt up a purchase, but at the same time, I have a gui that I want to show. If the user presses accept or decline to the purchase, the gui will disappear.

Here is my script:

local wat = 607329813
script.Parent=game.ServerScriptService
local market=game:GetService("MarketplaceService")
for i,v in pairs(game.Players:GetChildren()) do
    if not market:PlayerOwnsAsset(v,wat) then
        market:PromptPurchase(v,wat)
    end
end
game.Players.PlayerAdded:connect(function(player)
    if not market:PlayerOwnsAsset(player,wat) then
        market:PromptPurchase(player,wat)
    end
end)

Also the GUI's name is GUI in case that helps.

0
Well, you can destroy the GUI when the player chooses Accept or Decline. TheePBHST 154 — 6y
0
Yes, that is what I need help with. jackalota 9 — 6y

Answer this question