Let's start with a simple example. Create a new module by creating a folder named `lucky` and placing it [somewhere where Premake can find it](Locating-Scripts.md). Create a new file inside this folder named `lucky.lua`, with this simple starter module:
`require()` is [Lua's standard module loading function](http://www.lua.org/pil/8.1.html) (though the version in Premake has been extended to support [more search locations](Locating-Scripts.md)). The first time a module is required, Lua will load it and return the module's interface (the table we assigned to `m` in the example). If the module is later required again, the same table instance will be returned, without reloading the scripts.
Any local variables or functions you define in your module will be private, and only accessible from your module script. Variables or functions you assign to the module table will public, and accessible through the module interface returned from `require()`.
Here is an example of a public function which accesses a private variable:
```lua
-- lucky.lua
-- My lucky Premake module
local m = {}
-- This variable is private and won't be accessible elsewhere
local secretLuckyNumber = 7
-- This function is public, and can be called via the interface
function m.makeNumberLucky(number)
return number * secretLuckyNumber
end
return m
```
You could then use this module's functions in your project scripts like so:
Note that if you decide you want to [share your module](/community/modules) with other people, there are a [few other considerations to make](Sharing-Your-Module.md).