I've been working on a gamepass shop gui but I scrapped it in favor of a shop using clickdetectors. I've used the wiki to research clickdetectors and gamepasses but I still can't get it to work. The idea is that when a player left clicks on the part with the clickdetector, it prompts the gamepass purchase. The following localscript is in the clickdetector:
local player = game.Players.LocalPlayer
local gamePassId = 5820057
script.Parent.MouseClick:Connect(function()
game:GetService('MarketplaceService'):PromptGamePassPurchase(player, gamePassId)
end)
What am I doing wrong?
