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

It does not give me 100 extra points?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

I don't know what is wrong. I have this in workspace in normal script. Scripts name: PurchaseHandler

local MarketplaceService = game:GetService("MarketplaceService")
local Points1=278389550 --Id
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

MarketplaceService.ProcessReceipt = function(receiptInfo) 
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == Points1 then
                player.leaderstats.Points.Value=player.leaderstats.Points.Value+100
            end
        end 
    end
    local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId
    PurchaseHistory:IncrementAsync(playerProductKey, 1)  
    return Enum.ProductPurchaseDecision.PurchaseGranted     
end

1 answer

Log in to vote
0
Answered by 9 years ago

I am not sure if this would help, but on line 9 you didn't spell a word correctly! Its Value not Valu I think :D

0
If you would read the whole script it is spelled right. View the whole script and you will see. FiredDusk 1466 — 9y
Ad

Answer this question