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]?
Yes, if you did an if/then expression to return the value if it's the right thing, you would just say:
return Items[i]