Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Not awarding player, with no debug error?

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

1 comment

0

Such bold, much wow.

2 answers

✓ Accepted answer

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

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.