Currently trying to add some dev products into my game. In Studio, the script works just fine. You’re able to purchase the product, and everything works as intended from there.
However, inside of an actual live game - it just takes your money and nothing happens.
Just to add this detail, there is only one ProcessReceipt line in the game.
Here’s the code.
local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local function processReceipt(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == 1192320275 then -- sitting frenzy
if player then
local SittingFrenzy = game:GetService("ReplicatedStorage"):WaitForChild("DevProducts"):FindFirstChild("Sitting Frenzy")
for i,player_ig in pairs(game.Players:GetPlayers()) do
local player_gui = player_ig:WaitForChild("PlayerGui")
local hud = player_gui:FindFirstChild("HUD")
local gui = script.SittingFrenzy:Clone()
gui.Parent = hud
gui.PlayerWhoBought.Text = "paid for by ".. player.Name.. "!"
game.Debris:AddItem(gui, 180)
end
if SittingFrenzy.Value == false then
SittingFrenzy.Value = true
wait(180)
SittingFrenzy.Value = false
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt
Any suggestions / ideas on how to resolve this issue would be greatly appreciated. I’ve done my fair share of searching on google and the dev forums trying to resolve this problem, and I’ve had no luck.