Hello devs,
I am trying to test whether my script is working properly, so I provided the following code:
local enemiestable = mpcontrol.findEnemies(enemies)
if not enemiestable then
print(enemiestable)
print(table.find(enemiestable, othermp))
end
the module function mpcontrol.findEnemies
finds the values of various ObjectValue instances and returns them in a nice, neat table. Usually in the script, the table prints as {}.
I also tried if enemiestable ~= nil then
and if enemiestable ~= {} then
, but both of these are inconsistent.
However, the script I provided is not supposed to print when the table is empty.
How do I fix this?
More importantly, how do I understand how tables work when it comes to their boolean values? The devhub says that tables can store any type of value that isn’t nil.
Thank you in advance.