I am making a game. I am trying to make a script that will prompt the player to buy a gamepass when they click a button on a SurfaceGUI. However, the function isn't executing, and I don't know why.
If it helps, it is in a LocalScript.
script.Parent.MouseButton1Click:Connect(function()
local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
print("vars")
mps:PromptGamePassPurchase(player, 10772382)
print("prompt")
end)