It is a localscript, parented to a frame It is supposed to load all your items in the frame, but it only loads one item.
Player = game:GetService('Players').LocalPlayer
ParentFrame = script.Parent.Frame
ScrollingFrame = ParentFrame.ScrollingFrame
Templates = ParentFrame.Templates
Remotes = game:GetService('ReplicatedStorage').RemoteEvents
function RemoveList()
for i, v in pairs(ScrollingFrame:GetChildren()) do
if v.ClassName ~= 'UIGridLayout' then
v:Destroy()
end
end
end
function LoadEquippedItems(Item)
if Item == nil then return end
RemoveList()
ParentFrame.HelpText.Visible = false
task.wait()
local TempClone = Templates.Unequip:Clone()
TempClone.Item.Text = Item.Name
TempClone.Parent = ScrollingFrame
TempClone.Visible = true
end
function LoadUnequippedItems(Item)
if Item == nil then return end
RemoveList()
ParentFrame.HelpText.Visible = false
task.wait()
local TempClone = Templates.Equip:Clone()
TempClone.Item.Text = Item.Name
TempClone.Parent = ScrollingFrame
TempClone.Visible = true
end
function RefreshEquippedItems()
for i, v in pairs(Player.StarterGear:GetChildren()) do
LoadEquippedItems(v)
end
end
function RefreshUnequippedItems()
for i, v in pairs(Player.StoredItems:GetChildren()) do
LoadUnequippedItems(v)
end
end
ParentFrame.EItemsTab.MouseButton1Click:Connect(RefreshEquippedItems)
ParentFrame.UItemsTab.MouseButton1Click:Connect(RefreshUnequippedItems)