Hello, Current working on an inventory UI
I am not sure on how to grab the specific value, to equip. Aka, a weapon.
Currently, I can equip any tool in my backpack cause it has the same but how would I grab the key and value of a specific object in my table?
local Items = {}
local function UpdateItems()
UI.Backpack:ClearAllChildren()
for _,ItemObj in pairs(Player.Backpack:GetChildren()) do
if GameItems:FindFirstChild(ItemObj.Name) then
table.insert(Items, ItemObj)
end
end
end
Would it be just be Items[I]?

2 comments
You should look into dictionaries - this way you can extract specific array elements without needing any kind of loop. I usually opt for dictionary utilization over some extraction algorithm.
ok, will do. Thank you.