How do you create Modules and load in functions?

Hello,

I am currently working on a module for my game, but I get an error when I try to retrieve a function from the file.

Here is my module, called grid.lua:

local t = {} local function test() print("Hello World!") end return t

And here is how I load it in to main.lua:

local grid = require "grid" grid.test()

Any help would be appreciated.

function t.test()

end


load same as you have done above.

Take a look at rob miracles score module thats what helped me get started on modules.

T.

Great, this worked fine.

Thanks for the help!

function t.test()

end


load same as you have done above.

Take a look at rob miracles score module thats what helped me get started on modules.

T.

Great, this worked fine.

Thanks for the help!