PromptProductPurchaseFinished firing extra times

This section of code creates multiple instances for some reason. On the first purchase, it makes one value, on the 2nd purchase, it makes 2 values, on the third it makes 3 values, and so on.

What the heck?

A connection is made to the ‘PromptProductPurchaseFinished’ signal of the MarketplaceService each time the ‘RemoteEvent’ object is fired. Remember that connections stack, they do not override, take a look at the following example.

local Game = game
local Players = Game:GetService("Players")

local function OnPlayerRemoving(Player)
	print(Player.Name) --Prints the player's name 100 times.
end

for _ = 1, 100 do
	Players.PlayerRemoving:Connect(OnPlayerRemoving) --This event connection is made 100 times.
end
1 Like

I actually ended up fixing this with a debounce but thanks anyway