I’m trying to make a developer product, but I get an error saying that Studio is indexing nil with UserId? What am I doing wrong?
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productID = 1672911914
wait(10)
local function processReceipt(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.UserId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
print("Developer product has been purchased successfully")
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt()