Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have a couple dev products but whenever they each add 500 gems. How do i fix this?

+100 gems

local MarketplaceService = game:GetService("MarketplaceService")
local plrs = game:GetService("Players")
local gem500 = 985556504

local function processReceipt2(recieptInfo)
	
	local plr = plrs:GetPlayerByUserId(recieptInfo.PlayerId)
	if not plr then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	if plr then
		
		plr.Gems.Value = plr.Gems.Value + 500
		
	end
	
	return Enum.ProductPurchaseDecision.PurchaseGranted
	
end

MarketplaceService.ProcessReceipt = processReceipt2

+500 gems

local MarketplaceService = game:GetService("MarketplaceService")
local plrs = game:GetService("Players")
local gem500 = 985556504

local function processReceipt2(recieptInfo)
	
	local plr = plrs:GetPlayerByUserId(recieptInfo.PlayerId)
	if not plr then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	if plr then
		
		plr.Gems.Value = plr.Gems.Value + 500
		
	end
	
	return Enum.ProductPurchaseDecision.PurchaseGranted
	
end

MarketplaceService.ProcessReceipt = processReceipt2

everything else works just fine, the buttons promt the right item but idk why it only gives 500

3 comments

1

you just posted two identical scripts

0

Because both the scripts are adding 500 gems

0

oh no that was an accident.

1 answer

this was supposed to be the first one sorry

local MarketplaceService = game:GetService("MarketplaceService")
local plrs = game:GetService("Players")
local id = 985264450

local function processReceipt(recieptInfo)
	
	local plr = plrs:GetPlayerByUserId(recieptInfo.PlayerId)
	if not plr then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	if plr then
		
		plr.Gems.Value = plr.Gems.Value + 100
		
	end
	
	return Enum.ProductPurchaseDecision.PurchaseGranted
	
end

MarketplaceService.ProcessReceipt = processReceipt

This discussion is preserved as it was. New answers, comments, and votes are closed.