Returning Table Gives "nil"

I’m tying to call a function from a module script and it’s suppose to return a table, but it’s not. I’ve check to make sure the table is actually full before returning and it is (see the printed items in the console), but for some reason it still doesn’t show up.

Main Code:
image

Module Code:
image
(all getAnimations does is call LoadPackage() and pass it parameters)

Console:
image

Any help is appreciated.

Have you tried printing what the module returns?

AnimationsHolder can’t be nil
so I’m guessing the error is because Package is nil

It printed the items though

It’s not empty, it prints the items, just doesn’t return the table.

I tried, it returns an empty line.

which line is line 20?
not sure what for loop is erroring

“for I, V in pairs(Animations) do” in the “Main Code” portion. Edit: The one within the Module Script prints out the items, but the one in the “Main Code” errors, as it says there is no table.

could I see the AI_Module.getAnimations function?

image
Like I said, it just calls the LoadPackage().

oh I see the problem, you never return in this function

add return to line 60

1 Like

Ohhhh, yes thank you. I didn’t notice that I was returning it to the wrong place…