When I attempt to run the code for prompting a developer product purchase I end up getting this in the output:
07:57:29.741 - MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type nil
07:57:29.743 - Stack Begin
07:57:29.744 - Script 'Workspace.Gifts.Display.SurfaceGui.Script1', Line 9
07:57:29.745 - Stack End
I have no idea how to fix this and I have tried several things. Here's the code I'm trying to use as well:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productID = 965613937
local function promptPurchase()
local player = Players.LocalPlayer
MarketplaceService:PromptProductPurchase(player, productID)
end
script.Parent.Small.MouseButton1Click:Connect(promptPurchase)

4 comments
Correction: I removed a comment in the code, so that error is meant to point to line 8.
Is this normal script, if yes then change it into Local one. Because the error said "player" should be Player instance but it nil.
Or you can use PlayerAdded event to get the Player instance. And the comment above is wrong by the way :b https://developer.roblox.com/api-reference/event/Players/PlayerAdded
I just realize your script work, so I change my answer. Check it now.