The full Error:
MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type nil
The code:
local Players_ = game:GetService("Players")
Players_.PlayerAdded:Connect(function(plr)
TheLocalPlayer = plr
end)
local Market = game:GetService("MarketplaceService")
script.Parent.Activated:Connect(function()
Market:PromptProductPurchase(TheLocalPlayer, 1130818996)
end)
This is a LocalScript and it's in: StarterGui>ScreenGui>Frame>TextButton>LocalScript
Note: I probably know how to do a workaround for this, but I do want to know exactly why this happens so I can educate myself on that. Thanks! :D

1 comment
I think you have to use normal Scripts to prompt purchase instead of local scripts, also normal scripts won't work in startergui so put it in serverscriptservice