local function assertMulti(...)
local args = {...}
local helperTable = {}
for i=1, #args do
if i % 2 == 1 then -- if le position is an odd number
table.insert(helperTable, #helperTable + 1, assert(args[i], args[i+1])) -- add a new entry to the helperTable which is an assert() with the respective values of the entry that i is at and the entry after that
end
end
return helperTable -- return that table
end
assertMulti(false, "oh", false, "also oh") -- oh boi
This vararg function is meant to call assert() multiple times at once easily.
However, it outputs this.
Why does this happen, and how can I fix it?
(My intentions: I am editing my Variable & Functions Module (shared on le roblox site), and I want to be able to assert for errors more easily when people use the functions.)
#edit point oh
i'm mentally retarded
it works perfectly fine

1 comment
Oh lol i'm dumb. I didn't even notice it was working fine