Hello! I’m having yet another issue with my first foray into this kind of stuff.
I have the issue where I’m trying to make the same amount of buttons as the amount in a folder, and then change their names to the name of the tool itself. So far, this is my code.
function AddButtons()
-- Declare variables
local food = game.Lighting.helpr.Food
local foodInList = food:GetChildren()
local numberOfFood = #foodInList - 1
-- Main code
if numberOfFood == 0 then
print("Error Code 01 - Missing Tools")
else
while numberOfFood > 0 do
local button = script.Parent.ScrollingFrame.TextButton:Clone()
button.Parent = script.Parent.ScrollingFrame
numberOfFood = numberOfFood - 1
for i, q in pairs(foodInList) do
local text
if q.Taken.Value == false then
button.Text = tostring(q)
print(q)
q.Taken.Value = true
end
end
end
end
end
AddButtons()
Any idea how to fix this?
Only one button has the text 6.