Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Lua Comments in Roblox Lua.

CL0NED

Coder
A comment in lua text is completely ignored by the parser.
They can be useful to explain what a certain part of a script is doing, for example:

60
Comments in Roblox studio are usually coloured in green, but i changed my colour for the text.
What i just showed you is a short comment, you can start one with double hyphen (--).

You can also add Long Comments, we can define a opening with long brackets of level n as an opening square bracket followed by n equals symbol, then followed by another opening square bracket.An opening of a long bracket of level 0 is [[, and an opening long bracket of level 1 is written as [=[, and so on. Closing a long bracket is defined correspondingly; for instance, a closing of a level 4 is written as ]====]. Long comments starts with a opening long bracket of any level and ends at the first closing long bracket of the same level. Comments in this bracket can run through several lines and ignore any long brackets of any other level. They can contain anything expect from a closing bracket of the proper level.

Here is a example of a long comment:

Code:
--[===[
This is my very own long comment.
Guess what, it can contain hyphens like this --
Also contain long brackets other than it's own level like this:
And they can be closing long brackets like this: ]====]
Also thanks for reading this thread <3
]===]


 

Attachments

  • 1558876691819.png
    1558876691819.png
    114.2 KB · Views: 1
It’s pretty neat how every coding/scripting/programming language is different in regards to using comments. You got HTML <!— —>, CSS /* */etc

Thank you for sharing this! Im sure this will help Coders with learning Lua.
 
Back
Top Bottom