The window of purchasing the item on gamepass isn’t appearing when I talk to a NPC.
The script:
local marketplaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local lemonadeID = 31563881
script.Parent.ProximityPrompt.Triggered:Connect(function()
wait(2)
local success, message = pcall(function()
local hasPass = marketplaceService:UserOwnsGamePassAsync(player.UserId, lemonadeID)
if hasPass then
print("Player already have this gamepass")
else
marketplaceService:PromptGamePassPurchase(player, lemonadeID)
end
end)
end)