Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gamepass Problem with adding the amount?

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.