I was just wondering as I heard product purchases can fail sometimes. This is the code I currently have for one of my products:
local ID = receiptInfo.ProductId
if ID == ProductIDs.Robux10ID then
local PlayerID = receiptInfo.PlayerId
local Player = Players:GetPlayerByUserId(PlayerID)
if not Player then
return Enum.ProductPurchaseDecision.NotProcessedYet
else
Player.leaderstats[" Donated"].Value += 10
Player:SetAttribute("Donation", 10)
Player:SetAttribute("NameTag", "Starter Support")
CreateNameTag(Player, "[Starter Support]", Color3.new(1, 1, 1))
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Is there any issue with this possibly failing or anything?