Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What have I done wrong ? Currency shop script

Asked by 4 years ago

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 :(

0
Did you make sure an object named "Cash" was in your leaderstats folder when you tested the game? You can check by going to: Players > GleamingDrawsocute > leaderstats in the explorer. MegaManSam1 207 — 4y
0
No it says Money should I change cash to money on the script ? Gleamingdrawsocute -35 — 4y
0
Omg its working now thanks :) Gleamingdrawsocute -35 — 4y

Answer this question