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

Why doesnt my devproduct work? It wont updated leaderstats.

Asked by 2 years ago

If you need further explanation, feel free to ask

local MS = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local function processRecipt (receiptInfo)
    local plr = Players:GetPlayerByUserId(receiptInfo.PlayerId)
    if not plr then
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end
    if plr then
        print(receiptInfo.CurrencySpent)
        print(receiptInfo.CurrencySpent)
        game.Players:GetPlayerByUserId(receiptInfo.PlayerId):FindFirstChild("leaderstats").Donation.Value = game.Players:GetPlayerByUserId(receiptInfo.PlayerId):FindFirstChild("leaderstats").Donation.Value + receiptInfo.CurrencySpent  
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted
end

MS.ProcessReceipt = processRecipt()
0
Is receiptInfo a table? If so, use receiptInfo["Value"] epoke466 100 — 2y
1
Also maybe this will help, first check the output for an error which will be in red. Post the error and I can explain it. If there are no errors, between every line, type print("Mark") then go into the output and figure out which time "Mark" was not printed. That means that the line above has a bug. epoke466 100 — 2y

Answer this question