Yo guys! First of all, I hope your having a great day! Now basically, I am currently trying to make a module, MarketPlaceService2 (Wow, great name), now as you probably figured, I am using the actual MarketPlaceService for this, as MSS2 (MarketPlaceService2) will basically just be MSS with more features (such as a Built-In Gamepass Gifting System). Now I am still very early in the development of this, however, when I try to detect when the ProductPurchaseFinished, it doesn’t work. Here is the relevant code:
MSS:PromptProductPurchase(sender, productId)
local connection
connection = MSS.PromptPurchaseFinished:Connect(function(purchaser, assetId, isPurchased)
print("Prompt Finished, bought:", isPurchased, "Asset Id:", assetId, "productId:", productId)
if assetId == productId and isPurchased then
-- Gift gamepass.
connection:Disconnect()
end
end)
Now, the prompt fires and that works fine, however, the print statement I added in the PromptPurchaseFinished
event never prints. Also for a test I tried doing just:
MSS.PromptPurchaseFinished:Connect(function(purchaser, assetId, isPurchased)
print("Purchased")
end
Also didn’t print.
Here is the code that triggers the prompt btw:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local RS = game:GetService('ReplicatedStorage')
local MSS2 = require(RS.MarketPlaceService2)
local GamePassId = 68799591
local ProductId = 1293811121
script.Parent.MouseButton1Click:Connect(function()
local PlayerToGiftTo = nil
for _, player in Players:GetPlayers() do
if player == Player then continue end
PlayerToGiftTo = player
end
MSS2:GiftGamePass(Player, PlayerToGiftTo, GamePassId, ProductId) -- This is what fires the prompt
end)
(Local Script BTW)