Comments
Comments are, well, comments. Tidbits of information that you put inside a script. You can add notes, explanations of what's happening... Whatever you want! Comments begin with a double hyphen (--) and don't end until the line does.
game.Workspace.Hint.Text = "Hi!" -- This makes the hint say hi.
Comments are ignored by Lua, so code inside them won't run:
-- print("Hello world!")
In the above example, nothing will happen.
Block Comments
If you want a multiple line comment, called a block comment, you need it to start and end with 2 brackets and 2 hyphens.
--[[
This comment
has
many
lines.
=D
--]]
Block comments must have exactly 2 hyphens and 2 brackets at the beginning and end.
----[[
This is NOT a comment. There are 3 hyphens, not 2.--]]
Now you can head over to the next lesson.
game.Workspace.Hint.Text = "Hi!" -- This makes the hint say hi.
Comments are ignored by Lua, so code inside them won't run:
-- print("Hello world!")
In the above example, nothing will happen.
Block Comments
If you want a multiple line comment, called a block comment, you need it to start and end with 2 brackets and 2 hyphens.
--[[
This comment
has
many
lines.
=D
--]]
Block comments must have exactly 2 hyphens and 2 brackets at the beginning and end.
----[[
This is NOT a comment. There are 3 hyphens, not 2.--]]
Now you can head over to the next lesson.