of     1   

jrf2112
#48938059Sunday, June 19, 2011 9:21 PM GMT

How would I format a RBX.Lua script? To make it easy to read?
Sharksie
#48938107Sunday, June 19, 2011 9:23 PM GMT

Write it in Lua to make it easy to read.
jrf2112
#48938181Sunday, June 19, 2011 9:24 PM GMT

...
Sharksie
#48938281Sunday, June 19, 2011 9:26 PM GMT

No, really.
XlegoX
#48938285Sunday, June 19, 2011 9:26 PM GMT

I assume you're already using the standard tabbing style. Past that it totally depends on the scale and complexity of the task the script is performing. For example, the organization schemes that I use would only serve to make things more complicated and waste a lot of time if they were used on something only a couple hundred lines, but they make my several thousand line scripts far more readable and manageable.
jrf2112
#48939972Sunday, June 19, 2011 9:57 PM GMT

I dont want to know why I have to, that isnt what I asked. I asked how. I am asking for examples and what to do and what not to do.
BlueTaslem
#48940252Sunday, June 19, 2011 10:03 PM GMT

Use tabs, generally speaking (each time you go in a level, another tab is necessary). Keep your functions declared at the top, then variables declared, then connections, then loops, or some order that you like is also best. Something to help clean up code is separating functions and things by 2 lines, but otherwise there is only ever one blank line in the code.
DingDong272
Top 100 Poster
#48941108Sunday, June 19, 2011 10:18 PM GMT

Comment out all your code in plain english at the top of your script helps me. For example a button that changes colors script: --[[Button function ButtonFunc(arg) get button make it change colors end ]]
NecroBumpist
#48942938Sunday, June 19, 2011 10:49 PM GMT

I generally order my scripts in the following manner: >comments on function in general >variable declarations >embedded function definitions >code Then of course I have my own style of where to put new lines and such, just experiment till you find something you like.

    of     1