I want to be able for a player to buy a pass in- game. I’ve tried stuff like using the scripts for dev products but it hasn’t worked. I just want to prompt the gamepass once a player clicks on a ui
Script I’ve Tried:
ServerScript:```lua
local MarketPlace = game:GetService(“MarketplaceService”)
MarketPlace.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == 13664788 then
local plr = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
print("BoughtPass")
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
ButtonScript:
```lua
local id = 13664788
local mps = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
mps:PromptProductPurchase(plr, id)
end)```