is there anyway to search for a item in a table by its name?
✓ ANSWER ACCEPTED
how do you search for a item in a table?
1 answer
✓ Accepted answer
Yes. You can use a for loop:
Let's say you have a table with 2 items: Item1 and Item2. You want to find Item2 from the table.
local myTable = {
"Item1",
"Item2"
}
for _,object in pairs(myTable) do
if object == "Item2" then
print("Item2 found!")
else
print("This item is not Item2.")
end
end
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
yes there is. problem solved
link? please