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

ProcessReciept Callback ain't working?

Asked by 9 years ago
local player = game.Players.LocalPlayer

local creditshop = script.Parent.MainGui.ShopPrompt.ShopFrame.Shop.Credits

local shop1 = {creditshop:WaitForChild("10Credits")}

for _, v in pairs (shop1) do
    v.MouseButton1Click:connect(function()
        local passId = 21545568
        game:GetService("MarketplaceService"):PromptProductPurchase(player,passId)
        game:GetService("MarketplaceService").ProcessReceipt = function(receiptInfo)
            if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == player.userId then
                player.Credits.Value = player.Credits.Value + 10
                wait(1)
            end
        end -- It says error here
    end)
end

Can only register ProccessReciept callback on server I don't know why it has an error on an end.

Answer this question