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

Developer Product error "attempt to index local 'receiptInfo' (a nil value)"?

Asked by 4 years ago

I've been getting this error whenever I try to purchase a Dev Product

"attempt to index local 'receiptInfo' (a nil value)" on line 9

Script In ServerScriptService

local MPS = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local Fries = RS:WaitForChild("Fries")
local productID = 949968105

local function processReceipt(receiptInfo)

    local player = players:GetPlayedByUserID(receiptInfo.PlayerId)
    if not player then
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end

    if player then
        local char = game.Workspace:FindFirstChild(player.Name)
        local FriesClone = Fries:Clone()
        FriesClone.Name = "Fries"
        FriesClone.Parent = char
    end

    return Enum.ProductPurchaseDecision.PurchaseGranted


end

MPS.ProcessReceipt = processReceipt()
0
I'm not sure but i think you forgot to put the receiptinfo argument when you ran the function on line 26 or you just were making a variable with it. Derzett 51 — 4y
0
Ah Fixed it Jomeliter 55 — 4y

Answer this question