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)
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)
Oh that makes sesne...thats why it works when you have a click detector but not this...thx
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Is it a buy button?