So I’m trying to make a shop to buy in game currency. The button works and it comes up With buy for 50 robux And when you buy it it doesn’t actually give you the money please help I’ll show you the two scripts. Also I noticed on output when I try to buy the cash it keeps Saying “ Cash is not a valid member of Folder “
(This goes in currencyscript because serverscriptservice only shows up for me when I’m testing The game but when I’m not it just comes up with currencyscript)
Local MPS = game:GetService(“MarketplaceService”)
MPS.ProcessReceipt = function(receiptInfo) If receiptInfo.ProductId == 947607336 then local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId) player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 100 return Enum.ProductPurchaseDecision.PurchaseGranted end end
(This one is for the text button then local script)
MPS = game:GetService(“MarketplaceService”) id = 947607336 local player = game.Players.LocalPlayer
Script.Parent.MouseButton1Click:Connect(function() MPS:PromptProductPurchase(player, id) end)
Please help because if I can’t get this to work I’m never going to be able to make my game :(