Fake product purchase

Hello! So recently i’ve stumbled upon a weird activity in my game. I created a webhook for any purchases made in my game, and today i’ve came upon one person buying alot of products

but, when i go into the pending page under my group, that person is nowhere to be found. the username shown, leads to an account that is fresh, and has no friends or any major activity.

Here’s a snippet of my code:

	if SpongeCoinsProductsID[ID] then
			local player = game.Players:GetPlayerByUserId(userid)
			print("did it work")
			local DevProductINFO = MPS:GetProductInfoAsync(ID, Enum.InfoType.Product)
			local Data = {
				content = "**"..player.Name.."** has bought "..DevProductINFO.Name.." Product **("..DevProductINFO.PriceInRobux.." Robux)**!"
			}
			local newData = HttpService:JSONEncode(Data)

			pcall(function()
				print("Webhook successful!")
				HttpService:PostAsync(webhook, newData)
			end)

			player:WaitForChild("leaderstats"):FindFirstChild("SpongeCoins").Value += SpongeCoinsProductsID[ID]
			game.ReplicatedStorage.Remotes.PurchaseRobux:FireClient(player)
			game.ReplicatedStorage.Remotes.Notification:FireClient(player, "Thank you for your purchase! You have been given " ..SpongeCoinsProductsID[ID].. " Sponge Coins!", Color3.fromRGB(85, 255, 0):ToHex(), nil)
			print("Purchase Successful")

And so on for other products, i have never gotten a thing like this, and i wanna know is this some type of exploit, or a bug in my code?

4 Likes

A fresh new account with no friends and spamming purchase receipts? Yeah it’s definitely this

But, whats wrong with the code then?

A few things to check

  1. Does anybody other than you have access to the webhook link (accidentally shared even)
  2. Is there any remotes that when fired lead to this
  3. Is anything to do with the webhook stored in replicatedstorage or a local script, etc

If not, i’d say just change the webhook and see what happens
also i’m curious to see what in your script leads to the code you posted

  1. Only me and my friend, but i doubt that he trolled me by sending it.
  2. No
  3. Im pretty sure no

How were you processing that the Player has purchased the developer product? Can we see a fuller code snippet?

could you send the game you’re referencing?

edit: scrap that, join the game yourself, and press whatever leads to the dev product purchase a few times, see if that triggers the webhook
if so you aren’t verifying that the product was actually purchased

also what vapour said

Alright, here it is:

MPS.PromptProductPurchaseFinished:Connect(function(userid, ID, wasPurchased)
	if wasPurchased == true then
		if SpongeCoinsProductsID[ID] then
			local player = game.Players:GetPlayerByUserId(userid)
			print("did it work")
			local DevProductINFO = MPS:GetProductInfoAsync(ID, Enum.InfoType.Product)
			local Data = {
				content = "**"..player.Name.."** has bought "..DevProductINFO.Name.." Product **("..DevProductINFO.PriceInRobux.." Robux)**!"
			}
			local newData = HttpService:JSONEncode(Data)

			pcall(function()
				print("Webhook successful!")
				HttpService:PostAsync(webhook, newData)
			end)

			player:WaitForChild("leaderstats"):FindFirstChild("SpongeCoins").Value += SpongeCoinsProductsID[ID]
			game.ReplicatedStorage.Remotes.PurchaseRobux:FireClient(player)
			game.ReplicatedStorage.Remotes.Notification:FireClient(player, "Thank you for your purchase! You have been given " ..SpongeCoinsProductsID[ID].. " Sponge Coins!", Color3.fromRGB(85, 255, 0):ToHex(), nil)
			print("Purchase Successful")

I tried pressing the purchase button and canceling the purchase prompt, and it successfully cancells the transaction and doesn’t give anything when it would when you bought it

You should try using ms.ProcessReceipt instead.

2 Likes

Roblox highly advises not using PromptProductPurchaseFinished for handling purchase results on the documentation. This event is also client-sided meaning someone can fire it and act like they purchased the item. Use ProcessReceipt

2 Likes

Oh wow, i didnt know that, ill use ProcessReceipt then. Thank you alot!

One thing, ProcessReceipt is only for developer products, and for gamepasses, is this safe?

MPS.PromptGamePassPurchaseFinished:Connect(function(plr, ID, wasPurchased)
	if wasPurchased == true then
		if ID == 1693655701 then
			
			local GamepassINFO = MPS:GetProductInfoAsync(ID, Enum.InfoType.GamePass)
			local player = plr --game.Players:GetPlayerByUserId(plr.PlayerId)
			local Data = {
				content = "**"..plr.Name.."** has bought "..GamepassINFO.Name.." Gamepass **("..GamepassINFO.PriceInRobux.." Robux)**!"
			}
			
			local newData = HttpService:JSONEncode(Data)
			
			pcall(function()
				print("Webhook successful!")
				HttpService:PostAsync(webhook, newData)
			end)
			
			player:WaitForChild("VIPGamepassOwned").Value = true
			player:WaitForChild("OwnedSkins"):FindFirstChild("VIPSponge").Value = true
			player:WaitForChild("OwnedSkins"):FindFirstChild("VIPSquidward").Value = true
			game.ReplicatedStorage.Remotes.PurchaseRobux:FireClient(player)
			game.ReplicatedStorage.Remotes.Notification:FireClient(player, "Thank you for your purchase! You have been granted all VIP perks!", Color3.fromRGB(85, 255, 0):ToHex(), nil)
			print("Purchase Successful!")
	end
end)

Also, im convinced that this was an exploiter since this happened again today, for a different person. This time our anti cheat detected them trying to get unobtainable skins, and exploiting jump power. Which means they probably completed the transactions on client, and due to the funciton being inconvinient, it gave it to them.

The code snippet you provided looks fine, you can use PromptGamePassPurchaseFinished to process gamepass purchases.

Make sure you are checking and confirming purchases on the server (if you need to check on the client, make sure you do so on the server too), so exploiters cannot bypass your checks.

How would i check it between server and client?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.