I have a script that invokes a function with a remote function and receives 2 tables back. The output typically looks like this:
There are instances, however, where one of the tables can be blank. I’ve tried checking that with an if statement, but it hasn’t worked at all. I have confirmed that the table is empty as well.
These are the methods I’ve tried:
if Result[1] == {} then
if Result[1] == nil then
if Result[1] then --I flipped the code for this one so it would work with a true check
Result is a variable that invokes the function and returns what was shown in the picture local Result = RS.Inventory.Split:InvokeServer(tonumber(Slot.Name),HeldItemPresent)
Assuming the tables have numerical indexes, you can check the amount of indexes the table has by putting a # before whatever variable you use to store it. So in your case, try:
if #Result[1] == 0 then
Note - This will return the amount of ordered index items there are, e.g if index 1 doesn’t exist, it will return 0, even if index 2,3,4… etc exist.
If they don’t have numerical indexes, then you should do a for loop and save a variable that increments by one for each item in the table, or setup a function that will return true if it finds something in the table.