Custom Commands For Dummies. (Part 1)

(In this tutorial I am using 2 spaces to indent.)

Custom Commands:

Custom commands can come in many different ways. From simple commands to very complicated ones. For beginners, this is usually how you would want to layout your skript command.
command /example:
permission:
trigger:

There are many things that we can add to this command however, one thing to keep in mind is that in all custom commands you are probably going to see "trigger:". This is because whatever is in the trigger section is the code that is going to be run.

Next, let's talk about some things we can do with the actual code. I am going to give an example.
command /example:
trigger:
send "Hello!" to player

So we have a skript/script now. However, it is available to all players. Let's say we want only people with a certain permission to be able to run it. This is where "permission:" comes in. Usually for whatever permissions plugin you use, you can just simply put the permission as "server.admin" for example. I recommend using the LuckPerms plugin. However, it is up to you to decide.
command /example:
permission: server.admin
trigger:
send "Hello!" to player

If you do use luckperms you can just run the command "/lp user/group groupname/username permission set server.admin true". For permissions, you can also just say "op" if you want only server operators to have access to it.

Another thing that I suggest for custom commands you add a "permission message:" to your script. It will tell players that they do not have access to the command instead of them just running the command and nothing happens.
command /example:
permission: server.admin
permission message: You do not have permission to run that command!
trigger:
send "Hello!" to player


Ok. So now you have the real basics down. However, you want to do more. Here are just some of the examples of what you could do.
command /example:
permission: server.admin
permission message:
trigger:
give player wooden pickaxe named "Cool Pickaxe"

command /example:
permission: op
permission message: Only server operators can run that command!
trigger:
execute command "/title @a title {""text"":""Hello Player!"",""color"":""gold""}"

command /disco:
permission: player.disco
permission message: You cannot execute that command!
trigger:
loop 5 times:
wait 1 second
execute command "/title @a title {""text"":""\o>"",""color"":""gold""}"
wait 1 second
execute command "/title @a title {""text"":""<o/"",""color"":""gold""}"


So now you can do some stuff with it and you got some inspiration. Well, let me introduce something else to you, arguments. Arguments play a HUGE part in skript. Most times arguments look like this.
command /example [<string>] [<player>]:

You can refer to these arguments inside your code in many ways. When you are executing a command in your code or putting an argument inside quotes, you usually want to put "%arg-1%" depending on which argument you are referring to it could also be "%arg-3%" or "%arg-2%". Example:
command /pickaxe [<player>]:
permission: server.player
trigger:
execute command "/give %arg-1% wooden_pickaxe"

However, if you want to use this outside of a command or quotes use the following example.
command /pickaxe [<player>]:
permission: server.player
trigger:
give arg-1 wooden pickaxe

In part 2 of this tutorial, I will talk more in depth about these concepts. I will also introduce loops and if statements.
(Hopefully this helped)