Module:Bananas

From Terraria Wiki
Jump to navigation Jump to search
Important.svg

CAUTION: Terraria Wiki code is complex!!!

If you want to use this code on another wiki, wiki.gg staff are not able to assist you.
Please consider picking a different wiki to adapt code from, or making your own templates!
Remember that content on a wiki is more important than fancy formatting.

Lua.svg Documentation The documentation below is transcluded from Module:Bananas/doc. (edit | history)

This is an example Lua module for testing and demonstration purposes.

Usage

Wikitext

The module can be called from wikitext with the functions listed below.

hello

{{#invoke:Bananas| hello }}

Displays an exemplary text.

Examples
Code Result
{{#invoke:Bananas|hello}} Hello, world!

Other modules

The module can be called from another module with the functions listed below.

hello

require('Module:Bananas').hello()

Returns an exemplary text.

Examples
Code Variable result
local bananas = require('Module:Bananas')
local result = bananas.hello()
'Hello world'

local p = {}
 
function p.hello()
	return "Hello, world!"
end
 
return p