How can I code in an organized way

So, i’ve been recently looking for some help concerning code organization, some people told me that my code isn’t the best and should be way more optimized, this also demotivates me toward continuing my projects and stopping there, and i was wondering if you guys can give me tips on how i can improve my code and how i can migrate to something like this.

well, you have repeated code at the top

1 Like

There are slight differences in each instance- and I believe OP wants to migrate to something like this…

1 Like

i’m trying to migrate to something organized as shown in the picture,

Can we possibly see an instance of your code?

Here’s an example of how i code

repeated code isn’t really organized in my opinion

You can ask for feedback on scripts in #help-and-feedback:code-review. You can also use three ` to make code blocks, like so.

hi

Also. you have a bunch of repeated code at the top/