Hey could somebody help me with figuring out whats wrong with my script that controls donation buttons. heres the local script
local donations = {
['Donate10'] = 1265665801,
['Donate100'] = 1265665829,
['Donate1000'] = 1265665853,
['Donate10000'] = 1265665881,
['Donate100000'] = 1265665924,
}
local screen_gui = game.StarterGui.ScreenGui
for i, v in pairs(screen_gui:WaitForChild('Frame'):GetChildren()) do
if v:IsA('TextButton') and string.sub(v.Name, 1, #('Donate')) == 'Donate' then
local id = (donations[v.Name])
if not (id) then continue end
v.MouseButton1Click:Connect(function()
game:GetService('MarketplaceSerice'):PromptProductPurchase(game.Players.LocalPlayer, id)
end)
end
end
and heres what the buttons look like
all help would be much appreciated
It doesnt register let you buy the dev product once clicked on the button, no errors in output. Since no errors I think something is wrong with the logic
it still doesnāt register that im trying to purchase the button. Any other help? This is what the script is looking like right now
local donations = {
['Donate10'] = 1265665801,
['Donate100'] = 1265665829,
['Donate1000'] = 1265665853,
['Donate10000'] = 1265665881,
['Donate100000'] = 1265665924,
}
local screen_gui = game.StarterGui.ScreenGui
for i, v in pairs(screen_gui:WaitForChild('Frame'):GetChildren()) do
if v:IsA("TextButton") and string.sub(v.Name, 1, #("Donate")) == "Donate" and v.Name ~= "Donate" then
local id = (donations[v.Name])
if not (id) then continue end
v.MouseButton1Click:Connect(function()
game:GetService('MarketplaceSerice'):PromptProductPurchase(game.Players.LocalPlayer, id)
end)
end
end