code:(inside of TextButton parent is surfacegui)
script.Parent.MouseButton1Click:Connect(function(player) local productId = 1086368295 game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end)
error "- MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type nil"
MouseButton1Click doesn't have the player as a parameter. You should probably get the player through playeradded instead.
Okay, so there are no parameters of MousebUtton1Click, instead just make a variable like this:
local player = game.Players.LocalPlayer
Code:
script.Parent.MouseButton1Click:Connect( function() local player = game.Players.LocalPlayer local productId = 1086368295 game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end )