1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript Some Skript basics covered

Discussion in 'Tutorials' started by LeotomasMC, Apr 18, 2019.

  1. LeotomasMC

    LeotomasMC Member

    Sep 1, 2018
    Likes Received:
    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
    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 (Text):
    1. on join:
    2.     set {_player} to player
    3.     wait 1 minute
    4.     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 (Text):
    1. {my.cool.variable.name} # this is OK
    2. {score.%player%} # this is not OK
    3. {scores.kills::%player%} # this is OK*
    4. {scores::kills::%player% # this is OK*
    5. {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!
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Sep 7, 2017
    Likes Received:
    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
    • Like Like x 1
  3. couger44


    Feb 19, 2017
    Likes Received:
    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.
  4. LeotomasMC

    LeotomasMC Member

    Sep 1, 2018
    Likes Received:
    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

Share This Page