Style Guide

= Robloxian Hacker Busters Scripting Style Guide = A style guide is important because you should write script that other hacker buster scripters can read and understand instead of them going "WAT THIS". So without any further ado, let's get into this!

File structure:
File structure should be like this

Here's an example:
 * 1) Prequisites  (Requires followed by Read-Only Globals)
 * 2) Variables
 * 3) Functions
 * 4) Globals  ( Global Variables followed by Global Functions)
 * 5) The rest of the script

Require should always be at the start.

Local vs Global
If you use global variables, always prefix with _G. to make searching with control+F a lot easier. '''NEVER JUST MAKE A VARIABLE WITHOUT LOCAL, _G. OR SHARED.'''

Also try to avoid shared unless absolutely necessary. Since there is almost no limit on how many global variables you can have, that should not really be needed.

Scripts with many variables
If your script has over 100 or so variables, in prequisites, make a line like this: Now, you can add local variables the same way you add global ones. Simply put them all in a table! Don't do this for for loops, function parameters, etc. Only use for regular local variables.

Tables
If you have a few entries in a table, make them like this: If you have so many that they will have to scroll right, don't put them in like that. Press enter so basically instead of this do this:

Functions
ALWAYS PUT LOCAL BEFORE THEM unless they're in _G.. That is the ONLY exception.

Breaking them up
If there is a really long if statement, put them on multiple lines.

Don't do this:

Do this:

It is really annoying for most people when they have to scroll to the right and left constantly.

Brackets
When using an if statement, always surround them with brackets for readability.

Don't do this: Do this:

Nesting
Nesting is very important if you want people to actually understand what your script does. Nesting is when you write if statements inside of other ones.

With nesting: Without nesting (don't do this): The second script is a little bit more confusing. Once you get to longer scripts, it will get very confusing. That is why nesting is important.

While loops
Don't do this: Do this: Obviously you can put a number between the brackets.

wait(Number) vs wait
With wait(Number), you can be sure of how long it is waiting for but with wait, you can't. Fortunately, it is almost always 1/30th of a second. (Can be slower with lag.) If the number you have is smaller than 1/30 then it will just do the function as if it was wait with no parameter.