Skript Some Skript basics covered

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

LeotomasMC

Member
Sep 1, 2018
2
0
0
29
Hey there. This post will help you get into skript if you are just starting. What is shown here may not be the best conventions for making scripts, as this is not very advanced.

First, lets get into what you need to know. Skript files are .sk files. When you create your file, it will be named
<something>.sk
Make sure you dont make your file named <something>.sk.txt

Next, lets go over some basic things to get you started. If you have had previous programming knowledge, be prepared to throw a lot of that knowledge out of the window. Skript's syntax at times feels a lot like Python. In Skript, Indentation is very important. If you have used Java, you would probably know that indentation doesnt matter in Java. Java is a language that I describe as being able to be written in one line. Any given Java file can usually be written in, you geussed it, one line. Java has indicators that tell it when an if statement ends, or other things like that. In Skript, you dont have these indicators, so it uses indentation to know when something ends.

Dont assume things when your asking for help. If someone gives you a piece of code, and asks you to try that, dont change it. Feel free to change it after testing the orignal.

Local Variables can seem complicated, but they really are not. If a variable name starts with an underscore '_' it is a local variable. Local variables are only temporary, and can only be accessed by the trigger it was created in. Local variables are never affected by other triggers. For example:
Code:
on join:
    set {_player} to player
    wait 1 minute
    broadcast "its been 60 seconds since %{_player}% joined the server!"
in this example, if a player joins, and then another player joins within 59 seconds of the other player, it does not say the second player's name twice


A big thing. Use list variables for anything that uses an expression in the variable name. Here are some examples:
Code:
{my.cool.variable.name} # this is OK
{score.%player%} # this is not OK
{scores.kills::%player%} # this is OK*
{scores::kills::%player% # this is OK*
{score%player%} # this is not OK
* some users use full lists, for everything. I personally dont because I think a . looks better, but lists do have advantages, such as being looped. If you plan on needing to loop it, use a list.

Some things that may annoy previous programmers:
strings are called "text"s, not strings
many other tiny things

If you have anything you would like me to add, just ask!
 
Hey there. This post will help you get into skript if you are just starting. What is shown here may not be the best conventions for making scripts, as this is not very advanced.

First, lets get into what you need to know. Skript files are .sk files. When you create your file, it will be named
<something>.sk
Make sure you dont make your file named <something>.sk.txt

Next, lets go over some basic things to get you started. If you have had previous programming knowledge, be prepared to throw a lot of that knowledge out of the window. Skript's syntax at times feels a lot like Python. In Skript, Indentation is very important. If you have used Java, you would probably know that indentation doesnt matter in Java. Java is a language that I describe as being able to be written in one line. Any given Java file can usually be written in, you geussed it, one line. Java has indicators that tell it when an if statement ends, or other things like that. In Skript, you dont have these indicators, so it uses indentation to know when something ends.

Dont assume things when your asking for help. If someone gives you a piece of code, and asks you to try that, dont change it. Feel free to change it after testing the orignal.

Local Variables can seem complicated, but they really are not. If a variable name starts with an underscore '_' it is a local variable. Local variables are only temporary, and can only be accessed by the trigger it was created in. Local variables are never affected by other triggers. For example:
Code:
on join:
    set {_player} to player
    wait 1 minute
    broadcast "its been 60 seconds since %{_player}% joined the server!"
in this example, if a player joins, and then another player joins within 59 seconds of the other player, it does not say the second player's name twice


A big thing. Use list variables for anything that uses an expression in the variable name. Here are some examples:
Code:
{my.cool.variable.name} # this is OK
{score.%player%} # this is not OK
{scores.kills::%player%} # this is OK*
{scores::kills::%player% # this is OK*
{score%player%} # this is not OK
* some users use full lists, for everything. I personally dont because I think a . looks better, but lists do have advantages, such as being looped. If you plan on needing to loop it, use a list.

Some things that may annoy previous programmers:
strings are called "text"s, not strings
many other tiny things

If you have anything you would like me to add, just ask!
Im sorry to say it, but this is a terrible "intro tutorial"
You jump right past talking about events/triggers, conditions, effects, commands, everything.
Variables are 100% useless if you don't know how to use events, conditions and effects.

If you are looking to learn Skript, this intro will teach you nothing about Skript other than how to use variables.
You should check out other tutorials made, such as this one
https://forums.skunity.com/wiki/general-skript-tutorial/
 
  • Like
Reactions: couger44
I have the same opinion as Shane, the tutorial was very bad. I think you should start to "teach" events, customized commands, effects/conditions and variables. But the variables you put there were meaningless and very poorly explained.
As Shane said, if you're going to do a shabby tutorial, at least put a link where you explain in more detail the steps you tried to explain.
 
I feel like i named this as more than it is. If i change the title to something like "Some basic things to know about Skript" or something like that, i feel that this might be better, as that was the original intention really