I wanted to add products to my game that give gems when you buy them, I copied the scripts from an older game I made (where the products work) and added it ti the game im working on right now. but the products didn't work
Script in button:
script.Parent.MouseButton1Click:Connect(function()
game.MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, 1148720462)
end)
script in ServerScriptService:
game.MarketplaceService.ProcessReceipt = function(reciptInfo)
local plr = game:GetPlayerByUserId(reciptInfo.PlayerId)
if reciptInfo.ProductId == 1148720462 then
plr.leaderstats.Gems.Value = plr.leaderstats.Gems.Value + 250000
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
When I click the button the buy message pops up, when I click buy its says purshase succesfull but the gems aren't adding

5 comments
maybe the purchase script is outdated
https://www.youtube.com/watch?v=Z3J6JDybSPY
In the guidelines it says "Attempts should be your own work. Don't take a free model and expect us to fix it." If this doesn't work, you should be contacting the youtuber who made it.
I have tried like 5 different scripts they all not work so its not the script that doesnt work
I also never said this is a free model script I copied from a youtuber