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

Gamepass Problem with adding the amount?

Asked by 6 years ago

Hello, I have a problem with the script below it works but everytime someone makes a purchase it adds another 50 to the total for example if you bought it once you'd get 50 twice 100 five times 250, can someone please find a problem in this script or message me on roblox to see more but i really need this done

game.Workspace.Board.Main.GoldVendor.x50Gold.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptProductPurchase(Player,179386976)
end)
-- and then it uses another code request in another script

if Info.ProductId == 179386976 then Data.Stats.Gold.Value = Data.Stats.Gold.Value + 50

1 answer

Log in to vote
0
Answered by 6 years ago
local button = script.Parent.Purchase 
local mpService = game:getService("MarketplaceService")

button.MouseButton1Click:connect(function()
    mpService:PromptProductPurchase(game.Players.LocalPlayer, 179386976)
end)

You could try starting it with LocalPLayer instead of player.

Ad

Answer this question