I made this a while ago, and still havent figured out whats wrong with this code:
--Server script
local MPS = game:GetService("MarketplaceService")
MPS.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == "1176113807" then
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 1700
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
Basically, it lets you buy our coins (currency) ingame. Here is also the code for making the prompt, which i parented to the gui button:
--Local script
MPS = game:GetService("MarketplaceService")
id = 1176113807
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Down:Connect(function()
MPS:PromptProductPurchase(player, id)
end)
The issue is yes, it does prompt it, but when you purchase the dev product, it wont give the coins.