Before we start, when I said "number things" or "number line things", I mean this (from ROBLOX studio);

Why should I keep my code clean?

Keeping you code clean is pretty important because you want to be able to read it when you need to debug, and if you need help with it, you want other people to be able to read it, too. You can think of it like handwriting. People will not know what you are writing if you handwriting is sloppy.

How can I keep my code clean and tidy?

The first thing I'm covering in this "tutorial" is indentations. They're the tabs you make when you're going to a new line from a variety of things, e.g., a function. The second line of the function should not be the same amount of tabs as the first one. Here is what I mean;

Example of a function with indentations

An example of bad indentation is this;

Example of bad indentation

Now let's get more in depth (functions inside functions)

When dealing with functions inside functions, it is important to indent so you know which part of the code goes with each function. An example of a function within a function is this;
Example with two functions

We can go even further and do 3 functions!

Example of 3 functions

Notice how the ends also have indents. The amount of indents an 'end' has correlates to the number function it is. The first function's (printHi()) end gets no indents. The second function's (PlayerAdded) 'end' gets 2 indents, so on and so forth.