I’ve seen people having the same problem but I can’t seem to find a solution. My dev products work fine in studio, even the testing option in studio. But when I actually play my game, it doesn’t work. Here are the scripts.
LocalScript (player click button GUI):
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA("ImageLabel") then
if v.Name ~= "PlatPlay" then
v.Selector.MouseButton1Click:Connect(function()
local amt = v.Amount.Value
local passId = v.PassID.Value
mps:PromptProductPurchase(player, passId)
end)
end
end
end
script.Parent.PlatPlay.Selector.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 26865833)
end)
ServerScript:
local repstorage = game:GetService("ReplicatedStorage")
local mps = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local id1 = 1231945549
local id5 = 1231945576
local id10 = 1231945618
local id25 = 1231945649
local id75 = 1231945672
local function processReceipt(receiptInfo)
local plr = players:GetPlayerByUserId(receiptInfo.PlayerId)
if not plr then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == id1 then
if plr then
wait(1)
print("id1")
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 1000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
if receiptInfo.ProductId == id5 then
if plr then
wait(1)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 5000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
if receiptInfo.ProductId == id10 then
if plr then
wait(1)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 10000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
if receiptInfo.ProductId == id25 then
if plr then
wait(1)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 25000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
if receiptInfo.ProductId == id75 then
if plr then
wait(1)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 75000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
mps.ProcessReceipt = processReceipt
Thank you!