purchased = false local Id = 20628541 script.Parent.ClickDetector.MouseClick:connect(function(player) Game:GetService("MarketplaceService"):PromptPurchase(player, Id) purchased = true if purchased == true then player.leaderstats.Points = player.leaderstats.Points + 10 end end)
Well, when you do that, you ask them to buy it, but right after you ask them, you don't even wait to see if they buy it or not, you just give points away, for free! However, there is an event that will tell you whether or not someone purchased your item. The link is here.
And this is how you'd use it:
local Id = 20628541 script.Parent.ClickDetector.MouseClick:connect(function(player) Game:GetService("MarketplaceService"):PromptPurchase(player, Id) Game:GetService("MarketplaceService"):PromptPurchaseFinished:connect(function(player, Id, purchased) if purchased then player.leaderstats.Points = player.leaderstats.Points + 10 end end) end)