Everyone on here is trying to be useful, and helpful, and make something actually worth reading. It gets kinda repetitive after a while. So I came up with the cool idea to teach you how to write the worst possible looking code (do the opposite of everything here if you want good code).
Don’t bother with variables
90% of the time I use variables, it’s to make the code more legible and overrall nicer. But if you aren’t trying to, don’t. The only time you should use variables is when it is aboslutely necessary to make your code functional.
DO:
script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 10
game.Players.LocalPlayer.leaderstats.Points.Value = 2
end)
DON’T
local button = script.Parent.Parent.TextButton
local plr = game.Players.LocalPlayer
local char = plr.Character
button.MouseButton1Click:Connect(function()
char.Humanoid.WalkSpeed = 10
plr.leaderstats.Points.Value = 2
end)
In the code below, this is fine to do for horrible code:
local canRun = true
script.BindableEvent.Event:Connect(function()
if canRun == true then
script.Parent.Color3 = Color3.new(1,1,1)
canRun = false
end
end)
But, this code is actually not fine to do for horrible code. You know why? That brings us into our next sub-section:
Don’t acurately name variables
Naming variables with useful names just makes it easier for anyone (including you) to understand. So, not having useful names is an important element to bad code.
DO:
local variable1 = true
script.BindableEvent.Event:Connect(function()
if variable1 == true then
script.Parent.Color3 = Color3.new(1,1,1)
variable1 = false
end
end)
Now, lets enter the next main section.
Don’t use indentation
This one is a quick one. Using indentation makes your code easier to read and much nicer. But, here, we want to do the opposite. Never ever ever press the Tab button on your keyboard.
DO:
if true then
while script.Parent.Parent.Value == true then
if not true then
print("Hello world")
else
print("The opposite of Hello world")
end
end
end
DON’T
if true then
while script.Parent.Parent.Value == true then
if not true then
print("Hello world")
else
print("The opposite of Hello world")
end
end
end
Next, we have a big one. One of the things used in code a lot to help people is:
Comments
Don’t use them. All they do is make your code better and nicer to read. And that’s just really lame. We need the worst code possible.
I won’t be providing any examples here, but I think you get it that you shouldn’t ever be writing this:
-- Comment
Loops
Instead of using the usual for
or while
loops, just repeat your code over and over again.
DO:
local var1 = 0
print(0)
var1+=1
print(1)
var1+=1
print(2)
var1+=1
print(3)
var1+=1
print(4)
var1+=1
print(5)
var1+=1
print(6)
var1+=1
print(7)
DON’T
local var1 = 0
while var >= 1 do
var += 1
print(var1)
end
Other fun little things to make your code look worse
- Give your instances unhelpful names
For example, instead of calling an instance for your main menu play button namedPlay
, name itTextButton1
. And repeat a similar proccess for every other instance you have. - Instead of using basic arithmetic when not needed, just use if statements to check if the variable is 1 for example. If so, make it 2. Here is an example:
if var1 == 1 then
var1 = 2
elseif var1 == 2 then
var1 = 3
end
- Don’t even press the Enter key. It puts all your code on one line. Hence, harder to read.
- Instead of just writing the boring, generic and unoriginal
:GetService(ServiceName)
Dogame.service("Workspace").Parent:service("UserInputService").Parent:service(DesiredService)
and if you feel like it, you could just keep adding more services! It takes more time, but it is worth it when you need that unreadable code for that one co-worker you don’t like.
Thanks for all the support and for taking the time to read this joke of a post! Hope you enjoyed it! Maybe I’ll make another on how to make the best looking code possible!