So I was making sure my dev products on my game work but for some reason it's not it charges the player but the player doesn't get anything for it...

They should recieve 50 coins but for some reason they are not

Receipt script :

local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
 
ID1= 33248065 -- Put Devoloper Product ID Here



MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_product_" .. receiptInfo.ProductId
local numberBought = ds:IncrementAsync(playerProductKey, 1)

local Player = game.Players:GetPlayerFromUserId(receiptInfo.PlayerId)
if receiptInfo.ProductId == ID1 and Player then
	game.Workspace.PlayerProfiles:FindFirstChild(Player.Name).Coins.Value = game.Workspace.PlayerProfiles:FindFirstChild(Player.Name).Coins.Value +50
end
return Enum.ProductPurchaseDecision.PurchaseGranted		
end


Button script :

local productId = 33248065 --Developer Product ID here
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)


2 comments

0

Please format your code properly. You should check your question to make sure there are no problems.

0

Fixed it my bad