I am working on a automatic donate buttons. It works but it only displays one product prompt. I have 6 donate buttons and 6 dev products. However, when I click the other buttons. It displays only “25” robux dev product. I am sorry if this is confusing!
local MPS = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local Buttons = script.Parent:GetDescendants()
for i, v in pairs(Buttons) do
if v:IsA("TextButton") then
v.MouseButton1Down:Connect(function()
for i, product in pairs(Buttons) do
if product:IsA("IntValue") then
MPS:PromptProductPurchase(plr, product.Value)
print(product.Value)
end
end
end)
end
end
Can you share the workspace layout of all the instances involved please? It seems like you are currently telling it to make multiple PromptProductPurchases per button click.
local MPS = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local Buttons = script.Parent:GetChildren() -- edit 1
for i, v in pairs(Buttons) do
if v:IsA("TextButton") then
v.MouseButton1Down:Connect(function()
local passInfo = v.PASS -- edit 2
MPS:PromptProductPurchase(plr, passInfo.Value)
print(passInfo.Value)
end)
end
end