The title is pretty bad, but basically, I have a “WeaponsUnlocked” folder in my player folder (Vulnerable to exploits, I know), Which has folders (primaries, secondaries, melees) that have booleanvalues in them that are the names of weapons in the game. And I wanna clone the Item Template from ReplicatedStorage and parent it to the item frame, which sets the names of the values and the images accordingly to each item. So the player can see it, if any of values are true. However, It isn’t cloning anything or isn’t printing any errors. This is my code.
script.Parent.LoadInv.Event:Connect(function(Type)
print("load inv fired")
for i, v in pairs(game.Players.LocalPlayer:WaitForChild("WeaponsUnlocked")[Type]:GetChildren()) do
print("cloning: ".. Type)
if v == true then
local itemThing = game.ReplicatedStorage.ItemTemplate:Clone()
itemThing.Parent = game.Players.LocalPlayer.PlayerGui.Loadout.Frame.Items.Pages.Page1
itemThing.TextLabel.Text = v.Name
itemThing.Image = game.ReplicatedStorage.WeaponStats[v].image.Value
end
end
end)