lua

star 9

Lua scripting for game development, embedded systems, and configuration. Use for .lua files.

G1Joshi By G1Joshi schedule Updated 2/10/2026

name: lua description: Lua scripting for game development, embedded systems, and configuration. Use for .lua files.

Lua

A powerful, efficient, lightweight, embeddable scripting language.

When to Use

  • Game Development (Roblox, WoW, Love2D)
  • Embedded Systems
  • Configuration scripting (Neovim, Nginx)
  • Extending applications

Quick Start

print("Hello, World!")

function factorial(n)
  if n == 0 then
    return 1
  else
    return n * factorial(n - 1)
  end
end

Core Concepts

Tables

The only complex data structure in Lua. Used as arrays, dictionaries, sets, and objects.

t = { key = "value", [1] = "first" }
print(t.key)

Metatables

Allow changing the behavior of tables (e.g., operator overloading, inheritance).

Indices

Arrays are 1-indexed (start at 1, not 0).

Best Practices

Do:

  • Use local variables by default (performance and scope)
  • Use standard libraries where possible
  • Understand table length operator # behavior with holes

Don't:

  • Pollute the global namespace
  • Ignore nil (undefined variables are nil)

References

Install via CLI
npx skills add https://github.com/G1Joshi/Agent-Skills --skill lua
Repository Details
star Stars 9
call_split Forks 2
navigation Branch main
article Path SKILL.md
More from Creator