I’m currently writing a market place handler, however Roblox wont recognise the dev product id (I’ve tried with gamepasses) its seemingly for no reason.
Module:
local MarketPlaceService = game:GetService("MarketplaceService")
local Global = {}
MarketPlaceService.ProcessReceipt = function(receiptInfo)
print(receiptInfo)
return Enum.ProductPurchaseDecision.PurchaseGranted
--local purchase = Global[receiptInfo.PlayerId]
--purchase._CallbackConnection:Disconnect()
end
local marketplacehandler = {}
marketplacehandler.__index = marketplacehandler
function marketplacehandler.PromptPurchase(id : number, player)
local self = setmetatable({},marketplacehandler)
self.__index = self -- allow for connections
Global[player.UserId] = self
MarketPlaceService:PromptPurchase(player,id)
return self
end
function marketplacehandler:Connect(Callback)
if not Callback then return nil end
self.Callback = Callback
local Returned = setmetatable({},self)
function Returned.Disconnect()
if self.Callback == Callback then
self.Callback = nil
else
warn("[Refer][MarketPlaceHandler] Already disconnected callback or callback was changed before disconnect")
end
Returned = nil
end
self._CallbackConnection = Returned
return Returned
end
return marketplacehandler
Script:
local blah = require(script.Parent)
local pla = game.Players:WaitForChild("jake_4543",150010513513)
local purchase = blah.PromptPurchase(96424210,pla)
local c
c = purchase:Connect(function()
print("a")
end)
No warnings or errors in the output