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

Is this Developer Products script correct?

Asked by 9 years ago

This LocalScript is locating in a textbutton, and on click it should promptpurchase, and if purchased change the visible property of two frames. When I click it, it doesn't do anything. Yes, my hierarchies are correct and no, I cannot show the output, because you can't purchase developer products in studio apparently.

local productId = 22903689
player = game.Players.LocalPlayer
gui = player.PlayerGui.ScreenGui
loading = gui.loading
results = gui.results
MarketplaceService = game.GetService("MarketplaceService")

script.Parent.MouseButton1Down:connect(function(player)
    game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
    MarketplaceService.ProcessReceipt = function(receiptInfo) 



    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then



            if receiptInfo.ProductId == productId then 
                loading.Visible = false
                results.Visible = true
            end
        end 
    end
    end


    end)
0
Sorry for the rude answers, we are working on getting them Terminated from the Website. TheeDeathCaster 2368 — 9y

Answer this question