Checking When Player Buys Clothing?

I have an issue, How can i detect when the player buys the clothing, I get no receipt, also not to mention the bool for equipIfPurchased does not work either. Does anyone know how can i get the receipt or at least see when the player successfully buys the clothing?

local MarketplaceService = game:GetService("MarketplaceService")
local ServerScriptService = game:GetService("ServerScriptService")
local Manager = require(ServerScriptService.PlayerData.Manager)

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local promptPurchaseEvent = Instance.new("RemoteEvent")
promptPurchaseEvent.Name = "promptPurchaseEvent"
promptPurchaseEvent.Parent = ReplicatedStorage


ReplicatedStorage.promptPurchaseEvent.OnServerEvent:Connect(function(ply, item_ID)
	MarketplaceService:PromptPurchase(ply, item_ID, true)
	print(ply, item_ID)
	-- this is a clothing item.
end)


MarketplaceService.ProcessReceipt = function(receipt_info)
	print(receipt_info)
end
local MarketplaceService = game:GetService("MarketplaceService")
local ServerScriptService = game:GetService("ServerScriptService")
local Manager = require(ServerScriptService.PlayerData.Manager)

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local promptPurchaseEvent = Instance.new("RemoteEvent")
promptPurchaseEvent.Name = "promptPurchaseEvent"
promptPurchaseEvent.Parent = ReplicatedStorage



ReplicatedStorage.promptPurchaseEvent.OnServerEvent:Connect(function(ply, item_ID)
	local ProductInfo = MarketplaceService:GetProductInfo(item_ID)
	print(ProductInfo)
	MarketplaceService:PromptPurchase(ply, item_ID, true)
	repeat
		task.wait()
	until MarketplaceService:PlayerOwnsAsset(ply, item_ID)

        -- This is justmodule for data store
	Manager.AdjustSpent(ply, ProductInfo.PriceInRobux)
	Manager.AdjustPurchases(ply, 1)
end)```

Horrible fix, if any better solutions come please comment but putting it here so people in the future can use it!

Hey, can you check if process receipt shows other purchases? You should also check if there are 2 scripts changing the function (press ctrl + shift + f and type processreceipt), you can only have 1 function and this might be a problem where a different script just overwrites the other function


This may be useful, roblox has no receipt function for asset buying that i am aware of.

Huh, i guess that is the more probable reason

1 Like