Why isn’t the code working? The code is intended to generate a new Frame for each BoolValue found in the ‘Armors’ folder.
The code is:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local armorGui = player.PlayerGui.Armor
local scrollingFrame = armorGui.Frame.ScrollingFrame
local function createArmorFrames()
local originalFrame = script:FindFirstChild("Item")
local armorFolder = player:FindFirstChild("Armors")
local armorCount = 0
for _, value in pairs(armorFolder:GetChildren()) do
if value:IsA("BoolValue") then
armorCount = armorCount + 1
end
end
for i = 1, armorCount do
local newFrame = originalFrame:Clone()
newFrame.TxtName.Text = i
newFrame.Parent = scrollingFrame
end
end
createArmorFrames()
Bools do exist in the “Armors” folder.
