We use cookies on this site to enhance your user experience

Sep 25 2019, 2:01 PM PST 2 min

A comment in Lua is text that is completely ignored by the parser. Comments are generally added by the script writer to explain the code’s intent.

A short comment starts with a double hyphen (--) anywhere outside a string and it extends to the end of the line.

-- This is a comment
local var = 32  -- This is a comment following code on the same line

Comments can also be defined using a long format enclosed by brackets. Comments in this form can run for several lines.

This is a long comment.
It can contain short comment hyphens, like this:
  • lua
  • comments