I am currently working on this script where the gamepass buy prompt only shows up when you've pressed the button w/o having the gamepass. Problem is, the gamepass prompt still shows up, even when I do own the gamepass, and the frame I'm attempting to make visible, does not.
Here's my script:
local GamePassService = game:GetService("GamePassService")
local MarketService = game:GetService("MarketplaceService")
script.Parent.MouseButton1Down:Connect(function()
local plr = game.Players.LocalPlayer
if GamePassService:PlayerHasPass(plr,4984362) then
script.Parent.Parent["Jukebox Frame"].Visible = true
else
MarketService:PromptGamePassPurchase(plr, 4984362)
end
end)

2 comments
It could possibly be due to if you're testing this in studio. Try publishing the game and trying it on the actual game instead of studio.
My button just flat-out stops working in the game.