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?