What argument do I need to fire this event?

So, I’m trying to make it so when you buy a dev product, it fires a remote event. And I have everything written down correctly but, I keep getting errors for the argument that fires the client. I tried plr, reciptInfo, and many more. Here’s the script I’m using:

local MPS = game:GetService("MarketplaceService")

MPS.ProcessReceipt = function(reciptInfo)
	if reciptInfo.ProductId == REDACTED then
		game.ReplicatedStorage.SmashCat:FireClient() --The argument that I'm having trouble with
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

When firing the client you need to pass the player instance as an argument.

1 Like

The first argument should be the player. You mentioned plr so I’m not sure if you already tried this but does this work?

local MPS = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

MPS.ProcessReceipt = function(reciptInfo)
	if reciptInfo.ProductId == REDACTED then
		game.ReplicatedStorage.SmashCat:FireClient(Players:GetPlayerFromUserId(reciptInfo.PlayerId))
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end
1 Like

That work! Thanks for the help!