Server Script
local buttonlist = game:GetService("Workspace"):WaitForChild("Lobby"):WaitForChild("DonationBoardPart"):WaitForChild("DonationBoardGui")
local marketplaceSV = game:GetService("MarketplaceService")
local Buttons = {
[1] = {
1153796205,
"5RobuxButton"
},
[2] = {
1153796328,
"10RobuxButton"
},
[3] = {
1153796501,
"25RobuxButton"
},
[4] = {
1153796703,
"50RobuxButton"
},
[5] = {
1153797121,
"100RobuxButton"
},
[6] = {
1153797239,
"250RobuxButton"
},
[7] = {
1153797321,
"500RobuxButton"
},
[8] = {
1153797396,
"1000RobuxButton"
}
}
local function Buy(Player)
local Num = nil
for i,v in pairs(Buttons) do
if Num == nil then Num = i continue end
if Num < i then
Num = i
end
end
for i = Num, 1, -1 do
if Buttons[i] == nil then continue end
for d,k in pairs(buttonlist:GetChildren()) do
if k:isA("GuiButton") then
k.MouseButton1Down:Connect(function()
if string.lower(k.Name) == string.lower(Buttons[i][2]) then
marketplaceSV:PromptProductPurchase(Player,Buttons[i][1])
end
end)
return
end
end
end
end
game.Players.PlayerAdded:Connect(function(Player)
Buy(Player)
end)