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

This currency purchase script doesn't work even though it works on another button. Why?

I have a button so you can buy currency in my game and I use the same script to buy 500 points as the one to buy 50 points, the 500 points button works, but the 50 points doesn't work at all. The scripts are the exact same, just with the product id and point giver changed. That's it, and it doesn't event get to the part where it prints the text... like, why??? Help please

local mps = game:GetService("MarketplaceService")

mps.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 1084562484 then
		print("Epic")
		local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
		player.rep.Value = player.rep.Value + 50
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

And the +500 script:

local mps = game:GetService("MarketplaceService")

mps.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 1084562922 then
		print("Epicly")
		local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
		player.rep.Value = player.rep.Value + 500
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

^^ this works, but whenever I try to put to change the 2 values for +50 points it doesn't work. WHY??????

1 answer

just used another tutorial it works now

2 comments

0

i was bouta answer this to xd

0

kind of a weird way to solve it but k

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