With my self-diagnosed “OCD”, I like to make sure my code is organized in an orderly fashion. I tend to keep comments at a minimum (which I highly recommend not to do), but I really do love to organize my scripts through sectioning different functionalities and utilizing good syntax practices.
Be sure to utilize indentation. Indenting is very important if you are looking to make your code look nicer and more readable.
Here is how I might section my scripts to make them aesthetically pleasing:
--Services--
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
--Fixed Instances--
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local Building_Info = PlayerGui:WaitForChild("Building Info")
local Template = script:WaitForChild("Template")
local Mouse = Player:GetMouse()
local Remotes = RS:WaitForChild("Remotes")
local RSDebris = RS:WaitForChild("Debris")
local VPTemplate = RSDebris:WaitForChild("ViewportTemplate")
local Placeables = RS:WaitForChild("Placeables")
local Placement_Controls = PlayerGui:WaitForChild("Placement Controls")
--Modules--
local Placement = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("Class"))
local ObjectModule = require(RS:WaitForChild("Modules"):WaitForChild("Object_Level Module"))
local placement = Placement.new(Player:WaitForChild("Plot"):WaitForChild("CurrentFloor").Value)
local isMobile = UIS.TouchEnabled
--Variables--
local tableModel = nil
local rotation = 0
local moveRotation = 0
Obviously, it doesn’t look the NEATEST. It does look much more organized than scrambling around a bunch of variables with a bunch of numbers along with module scripts. This is how I approach my code Feel free to bake me!!!