I have everything else set up, but I want it to detect it so if you’ve clicked on the in this case, the 5th or 6th reply, then it would do something else.
if not table.find(Replies, "Reply"..tostring(ReplyNumber)) then -- needs to fix
-- firing the server with no replies here
else
-- firing the server with replies here
end
-- Creating a table within a table
myTable = {
innerTable = {
key1 = "value1",
key2 = "value2"
},
anotherKey = "anotherValue"
}
for key, value in pairs(myTable) do
if type(value) == "table" then
for innerKey, innerValue in pairs(value) do
print(innerKey, innerValue)
end
else
print(key, value)
end
end
table.find(mytable, valuetolookfor) searches for a value. And as you found out, to determine if a key exists in the table, you just have to do mytable[key] which returns the value of the key or nil if there is no value at that key. Just a bit of info on the reason that table.find failed to work as you wanted it to.