GSmGpE6CwX2y9JjB25B8
We use cookies on this site to enhance your user experience

Aug 29 2019, 9:17 AM 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:
--
--
--]]
Tags:
  • lua
  • comments