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

Not awarding player, with no debug error?

Asked by 10 years ago

For whatever reason this does not award the player their player points they bought, and it does not show any error in the debug. Any idea?

This works with buying extra cash, but not player points for some reason, even tried prints and nothing showed up.

local Service = Game:GetService("PointsService")

local Products={
    ["0"]=2,
    ["0"]=5,
    ["0"]=10,
    ["0"]=50,
    ["0"]=500
}

local Prompt = Game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

Game:GetService("MarketplaceService").ProcessReceipt=function(Receipt)
    local PlayerProductKey = Receipt.PlayerId.."_"..Receipt.PurchaseId
    for _,Player in pairs(Game.Players:GetChildren())do
        if Player.userId==Receipt.PlayerId then
            for i, v in pairs(Products)do
                if tostring(Receipt.ProductId)==i then
                    Service:AwardPoints(Player.userId, v)
                    Prompt:IncrementAsync(PlayerProductKey, 1)
                    return Enum.ProductPurchaseDecision.PurchaseGranted
                end
            end
        end
    end
end
0
Such bold, much wow. OniiCh_n 410 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

Could it possibly be that there is no error, but you are not authorized to award points?

Ad
Log in to vote
0
Answered by
OniiCh_n 410 Moderation Voter
10 years ago

You must HAVE Player Points to AWARD Player Points. To get PP as a dev, players need to buy game passes or DevProducts.

Ex) Player buys R$10 worth of DevProducts. PP are awarded to the developer on a 1:3 (1 PP for every R$3 spent) You can then award those points back to the players, but you must have points to begin with!

Answer this question