This tutorial is part 1 of a series:
Be concise and consistent. It’s better to stick to one “good enough” styling rather than constantly experimenting and trying to over optimize. This style guide contains a list of guidelines that you should follow when writing trigger Lua code to make the code more readable and consistent.
First and foremost, be sure to install and properly setup StyLua, which will automatically format your code upon saving : Formatting with StyLua
A trigger file generally consists the following parts in order: