Skript How to read Skript Syntax

  • 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!

Ankoki

Staff member
Moderator
Supporter
Nov 5, 2020
55
13
8
21
England
www.ankoki.com
So I couldn't find any tutorials related to reading Skript syntax (yet I am blind so if i did miss one apologies), so I thought I'd break down how to read the syntax because it's one of the most fundamental things to understanding skript, yet many people struggle with it and rely on more advanced people telling them. So here is a basic way to understand skript's syntax!

Basic Breakdown:

[optional] - Text in square brackets are optional and do not have to be wrote for the syntax to work.

(option1|option2) - Text in brackets split with a "|" are a choice, where you can choose option1, or option2.

%string% - A type can be put between two percentage signs, and this requires text, such as "Hello" or a variable {_hi} which is set to text or the required type.

Example:
Code:
(message|send [message[s]]) %strings% [to %commandsenders%]
First, there is a choice, between "message", and "send [message's']" (s in square brackets is a strikethrough character, so I've used 's' as a replacement). In the second option, [message's'] is optional, and so is the 's' on the end, so this can be "message" with the first option, or any of the following combinations for the second option: "send", "send message", "send messages". We will use "send" for the rest of this example.

Next, the syntax takes in strings, such as "hello". We can also use a variable here as long as that variable contains text. Now, we have 'send "hello"'. This would work, and would send "hello" to the player which is in the current event.

The final part of this is optional, where we can specify who we are sending this message too. Say this was in a command, and our first argument was a player, and we wanted to send them this message. We can specify them here. If we were to do that, we would have 'send "hello" to arg-1'.

So the final result is:
Code:
send "hello" to arg-1

Hopefully this helped and if there's any feedback or anything i've missed, let me know :emoji_slight_smile: