Edit: I forgot to tell the server that the purchase had been processed. I created a developer product that allows you to purchase more credits, but then, if you leave and rejoin, you get the same amount of credits again. Does anyone know how to fix this?
Here is the script:
local mps=game:GetService("MarketplaceService") function getPlayerFromID(id) local plrs=game.Players:GetPlayers() for i=1,#plrs do if plrs[i].userId==id then return plrs[i] end end end mps.ProcessReceipt=function(info) if info.ProductId==22821479 then local plr=getPlayerFromID(info.PlayerId) plr.leaderstats.Cash.Value=plr.leaderstats.Cash.Value+1000 elseif info.ProductId==22821510 then local plr=getPlayerFromID(info.PlayerId) plr.leaderstats.Cash.Value=plr.leaderstats.Cash.Value+2500 elseif info.ProductId==22821535 then local plr=getPlayerFromID(info.PlayerId) plr.leaderstats.Cash.Value=plr.leaderstats.Cash.Value+5000 elseif info.ProductId==22821547 then local plr=getPlayerFromID(info.PlayerId) plr.leaderstats.Cash.Value=plr.leaderstats.Cash.Value+10000 end end
If you can help me, that'd be great!
You probably have a DataStore script somewhere in your game place which saves purchases. If you can find it, please post it, and I can help you further.