Hey can anyone help me figure out why when i use a gui for in game stats and i copy it so i have one for XP and Gold And when i try to test and buy the gold product it gives the the XP instead? Please Help. So here are both the scripts.
Gold ServerScriptService:
MarketplaceService = Game:GetService("MarketplaceService") MarketplaceService.ProcessReceipt = function(receiptInfo) players = game.Players:GetPlayers() currency = "Gold" addamount = 1000 for i=1,#players do if players[i].userId == receiptInfo.PlayerId then players[i].leaderstats[currency].Value = players[i].leaderstats[currency].Value + addamount end end return Enum.ProductPurchaseDecision.PurchaseGranted end
Gold In LocalScript In a Gui:
local productId = 23414926 -- change to your developer product ID local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end)
The scripts are the same for the gold only i changed the productid value to the xp instead Any idea on why it's buying the xp product when you click the gold?