Hello Developer Forum!
I would like to hear some tips about how to make my scripts look more professional and less rookie-like (or more appealing to the Scripter’s Eye)
Although a shorter might provide readability, it is subjective to your comprehension of the code. You might stick to the longer methods, but try some theory around the code and perceive code as chess move orders(that’s how I think usually).
Use module scripts. This stops you from repeating the same code again and again. Also, use comments so other scripters reading your code understand. Use indentation/whitespace, and make sure to use Variables instead of repeating something like
local Part = workspace.Part
-- Better than:
workspace.Part
Using loops can shorten down your code significantly for example:
local Array = {"Dogs", "Parrots", "Cats", "Mice", "Goldfish"}
-- Anyone who doesnt use loops would do
print(Array[1], Array[2], Array[3], Array[4], Array[5]
-- Using a loop
for index, pet in pairs(Array) do
print(pet)
end
Unfortunately, that shortening is only preference and sometimes throws a few scripters off for the unconventional(but not really, it’s just not regularly used) naming.
Unconventional? Shortening variables like that simply makes the script harder to maintain. It’s bad practice. If you want to obfuscate your code then it’s just not the best way to go about it.