I currently have a script which prompts a purchase:
local plr = game.Players.LocalPlayer local button = script.Parent local MarketplaceService = game:GetService("MarketplaceService") script.Parent.MouseButton1Click:Connect(function() MarketplaceService:PromptGamePassPurchase(plr, 6783022) end)
And I have this script for checking:
while true do local mpService = game:getService("MarketplaceService") mpService.ProcessReceipt = function(purchaseInfo) local plr = game:getService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId) if purchaseInfo.ProductId == 6783022 then print("Hey") end return Enum.ProductPurchaseDecision.PurchaseGranted end wait(1) end
But none of these are working
Place in a script in ServerScriptService
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local passId = 6783022 -- change this to your game pass ID. local function onPlayerAdded(player) local hasPass = false hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, passId) if hasPass == true then -- Enter What You Want It To Do end end Players.PlayerAdded:Connect(onPlayerAdded)