Package

Tip

This is a global variable named Package. It is not possible to initialize or create a new instance. It’s just a global variable.

Attention

This page is under construction.

Functions

Returns

Name

Description

string

GetName()

Gives the package name

Require(string ScriptFile)

Includes new .lua files

RequirePackage(string PackageName)

Includes other Package in this Package

Log(string Message)

Logs a message in the console (the proper and Nanos way)

Events

Name

Arguments

Description

Load

Is called as soon as a package is loaded.

Unload

Is called as soon as a package is unloaded.

Examples

-- prints the package name at the "Load" event
Package:on("Load", function()
  print("Load package: " .. Package:GetName())
end)

-- prints the package name at the "Unload" event
Package:on("Unload", function()
  print("Unload package: " .. Package:GetName())
end)