[Guide] - Creating a Skript
Skript is a new "coding language" that allows you to customize Minecraft's mechanics in plain, English sentences.
Lots of people are using Skript, and lots of people are confused on how to use it. This is intended to teach you how to use it.
Creating a command that broadcasts "Hello!" into chat.
Code (Text):command /hello!:
How do I use variables?
errormessage: &c&lAn error has occured!
errormessage: &c&lAn error has occured! #-- This is the variable -- #
command /error: #the command that makes the message show
send "[email protected]}" #Variable that will now show up in chat
Making a GUI appear on the person who executed the command's screen can be a challenge. However, it really isn't.
This sample will make the /open [player] display the arg-1's head in the center of the GUI.
Code (Text):command /open [<offline player>]:
open chest with 1 rows named "Test GUI :3"
wait 1 tick
format slot 4 of player with arg-1's skull named "&f&l%arg-1%" to be unstealable
Is it possible to use permissions?
Yes, it is possible to create and require the executer to have permissions to perform a command!
You are even able to set a no permission message. Example code for permissions:
Code (Text):permission: player.use
permission message: &cYou do not have permission!
They will be if you do not prevent it.
You must put "if arg-2 is not set:" and insert what should happen if it's not input correctly.
Code (Text):if arg-2 is not set:
send "&cSomething went wrong?"
if arg-2 is set:
open chest with 6 rows named "test" to player
wait 1 tick