Hi, so I'm making a GUI where if a player clicks it, it will ask them if they want to buy a shirt. Here is the script I already have.
local shirtId = 897595758
script.Parent.Mousebutton1click:connect(function()
game:GetService('MarketplaceService'):PromptPurchase(player, shirtId)
end)
I'm not sure what's wrong, but the (player is underlined in red so that's an error. Does anyone know what I'm missing? Any help is appreciated, thank you!

2 comments
try to put player in the parenthesis in the function
If this is in a LocalScript, you can't use just player. You'd have to use game.Players.LocalPlayer. If this is in a regular Script, then well change it to a LocalScript.