Im using this for a surface gui and it wont work.
local Shirt = 109854904 script.Parent.MouseButton1Click:connect(function(player) game:GetService("MarketplaceService"):PromptPurchase(player, Shirt) end)
The MouseButton1Down
event does not return the player that clicked - it returns the x
and y
coordinates of where the mouse was found when the gui was clicked. You need to define the player as game.Players.LocalPlayer
!
local Shirt = 109854904 local plr = game.Players.LocalPlayer --Define the player script.Parent.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptPurchase(player, Shirt) end)