Having Problem when making Product Wall

Hi Developers!.i recently was making Product Wall and i am having problems
Here is the script
script.Parent.MouseButton1Click:Connect(function()

game:GetService(“MarketplaceService”):PromptProdutPurchase(game.Players.LocalPlayer,862404013)

end)

another one

What specific problems are you having? Any errors? What’s going on?

SurfaceGui’s can’t detect input from inside of the workspace, they need to be inside the PlayerGui to be able to receive input. Just use the adornee property of the SurfaceGui and you should be fine, if that was your problem.

There is no Any problem in output do i need to write this with remote function?

[23:13:36.957 - PromptProductPurchase is not a valid member of MarketplaceService

It’s just a spelling error, it should be PromptProductPurchase.

So i made changed the local script to script and wrote this code

script.Parent.MouseButton1Click:Connect(function(player)

game:GetService(“MarketplaceService”):PromptProductPurchase(player,862404013)

end)
now it says

[23:19:34.842 - MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type nil

The MouseButton1Click function does not give you the player argument when you click it. Define a separate variable at the top of the script for the player.

local Player = game:GetService("Players").LocalPlayer