I have a script to sell a person my loader module but I get this error:
http://prntscr.com/8b63rt
Script:
script.Parent.MouseButton1Down:connect(function(Player) game:GetService("MarketplaceService"):PromptPurchase(Player, 259858254) end)
This is in a TextButton in a SurfaceGui.
My bad.
Surface GUIs are weird.. The ROBLOX wiki uses this:
local buyButton = game.Workspace.--Get the surface GUI local productId = ID buyButton.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, end)
The MouseButton1Down
event has two arguments : the X vector, and the Y vector. There is no player Argument, you could covert the player by using the PlayerAdded
event.
game.Players.PlayerAdded:connect(function(Player) -- script end)