PromptGamePassPurchaseFinished/PromptPurchaseFinished not working properly in team test

Hello everyone!
I made script which detects when player buys something in the game

mps.PromptGamePassPurchaseFinished:Connect(function(plr,passId,purchased)
	if purchased == true then
		print("Purchased.")
		local item = module.findItem(passId)

		local cost = item.Cost.Value
		local plrBy = game.Players:FindFirstChild(item.Parent.Parent.Parent.Parent.ClaimedUserName.Value)
		game.ReplicatedStorage.Events.Purchased:FireAllClients(plr, plrBy, cost)

		if cost then
			plr.leaderstats.Donated.Value += cost
		else
			print("Could not find cost.")
		end

		if plrBy then
			plrBy.leaderstats.Recieved.Value += cost
		else
			print("Could not find PlrBy.")
		end

		module.updateStandsEarned()

	else
		print("Not purchased.")
	end
end)

and the same function with PromptPurchaseFinished (that detects catalog items, not gamepasses)

In single test in roblox studio it work as expected (sorry if its low quality)

but when i click team test (so i can test it with my friend) the functions always says that the product wasn’t purchased

How to fix that?

Probably a studio bug, it shouldn’t error if you try to test it in a real Roblox server. Your code is fine.

2 Likes

Thanks for helping, it was really studio bug! But, its annoying beacuse i had to spend robux to check it. I guess i should make bug report?
Edit: nevermind, i don’t know how to make bug report

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