I would like to set up an in-game gamepass purchase that gives you the tool after buying the game pass in-game. This would be very convenient for players purchasing game passes, because implementing the current script I have right now would require them to wait for the server to restart.
Here is what I have
local Id = 626438744 --Change this number to your Game Pass ID.
script.Parent.ClickDetector.MouseClick:connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player, Id)
end)
Help would be much appreciated.

2 comments
Not working.
oh rip forgot to remove that "Local" sorry