My current script:
local CLICK_BLOCK = script.Parent
local ITEM_ID = 8827494 -- My gamepass
local Click = Instance.new("ClickDetector", CLICK_BLOCK)
Click.MouseClick:Connect(function(player)
game:GetService("MarketplaceService"):PromptGamepassPurchace(player,ITEM_ID)
end)

5 comments
You spelled PromptGamePassPurchase wrong. Should be PromptGamePassPurchase.
yup
Oh ok! I will try this now!
Well, It does not work. Like most of my things.
My bad. I forgot to say that this should be in a LocalScript, which should be in your Part. Then change "player" on line 7 to "game.Players.LocalPlayer". You don't need a click detector either. Instead, use MouseButton1Click. I will show you the complete script down below.