Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I fix this from giving everyone in the server points to only the person who purchased?

Asked by
3dsonicdx 163
10 years ago
--------------------------
local MarketplaceService = Game:GetService("MarketplaceService")
local buyButton = game.Workspace.TheLobby.Shop.DPVEND.BuyButton.SurfaceGui.TextButton
local productId = 19661235
local player = script.Parent.Parent
buyButton.MouseButton1Click:connect(function()
MarketplaceService:PromptProductPurchase(player, productId)



end)

MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId, isPurchased)
if isPurchased then
-- user purchased product, show confirmation box
wait(0.1)
player.Status2.DP.Value = player.Status2.DP.Value + 125
else
-- user didn't purchase product, do other stuff

end
end)

I don't know what's wrong. Does anyone know how to fix this? It's giving everyone 'DP'.

Answer this question