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

How do I implement ProcessReceipt into this code?

Asked by 4 years ago

The assetID is a Developer Product. On the wiki, it says I may need to use *ProcessReceipt * but I do not know how to implement this to my code. Please help.

game:GetService("MarketplaceService").PromptPurchaseFinished:Connect(function(player,assetID,wasBought)
local url = "" -- In My Real Game There is a URL for Discord WebHook
local HTTP = game:GetService("HttpService")

if assetID == 971131178 and wasBought == true then 
    local data = {
                        ['username'] = player.Name,
                        ['content'] = "has bought the product."
                }
                local newdata = HTTP:JSONEncode(data)
                HTTP:PostAsync(url, newdata)
                player:Kick("Product  Sucessfully Bought. Purchase Logs sucessfully sent. We will send you the product soon.")
                print("Bought product.")
    end

end)

1 answer

Log in to vote
0
Answered by 4 years ago

MarketPlaceService.ProcessReceipt = function(purchasedId, playerId, ...) end

more here

Ad

Answer this question