This is a script that takes the items in the player's backpack and puts the names of those things into the table things as a string. My problem is that when the player is holding an item, the item disappears from their backpack which means that it wont be located by the for loop. How could i modify this so that if they are holding an item, it finds it as well?
local things = {}
for _, v in pairs (player:GetChildren("Backpack")) do
things[v.Name] = v.Name
end

1 comment
I believe you could use ChildAdded for this, unless that is not what you're trying to do.