Im trying to make a screen GUI shop and I want to be able to sell anything. But when I go to test it the button does nothing. the script is...
local assetId = 27112438
function die() script.Parent.MouseClick:connect(function(player) Game:GetService("MarketplaceService"):PromptPurchase(player, assetId) end) end
script.Parent.MouseButton1Down:connect(die)
You made a mistake at events ;]
local assetId = 27112438 function die() script.Parent.MouseClick:connect(function(player) -- two functions :D Game:GetService("MarketplaceService"):PromptPurchase(player, assetId) end) end script.Parent.MouseButton1Down:connect(die)
The problem you have is that you made a little confusion with events. You had already set the event, but then, you send the exact same event again. (This makes LUA confusion and breaks script)
Try removing the function die() and the last even listener, like MasterDaniel told you.
script.Parent.MouseClick:connect(function(player) Game:GetService("MarketplaceService"):PromptPurchase(player, assetId) end)
Hope this helps you! Thanks, marcoantoniosantos3