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)
COMMUNITY QUESTION
What's wrong with my script to give player credits/points for purchasing a dev-product?
1 answer
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Bump1
This however, is against the new ROBLOX rules of selling player points or "Player Points shops", at least, this is how I would classify it.