Will this work?
local productId = 8849124 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() script.Parent:FindFirstChild("SelectionPopSound"):Play() game:GetService("MarketplaceService"):PromptPurchase(player, productId) end)
I have fixed it myself instead of
game:GetService("MarketplaceService"):PromptPurchase(player, productId)
it is
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)