Jump to content

Skript Tutorial #3 - Simple Layout.


kegnh

Recommended Posts

Hello, my name is itskegnh, and ill be showing you how to layout code in your scripts.
This tutorial assumes you've read my other tutorials.
 



A block of skript code contains 3 things.

  • An Event
  • A Condition (optional)
  • And An Effect

What is an Event?
    An event is a section of code that triggers when something happens (e.g. when a player joins)
    An Example event would be: on join: which triggers when a player joins

What is a Condition?
    A Condition is a check, and will only run the rest of the code if a condition or check is met.
    An Example of a condition would be: If player is online: which will only run if the player is online.

What is an Effect?
    An Effect is a line of code that does something. These are the lines of code that effect players or change things.
    An Example of an effect would be: kill the player  Which would kill the player.

Formatting Code?
An Example of This would be:

EVENT:
	IF CONDITION:
		EFFECT
	ELSE:
		EFFECT

The conditions are optional

What would be an example of code that actually looks like this?
Well for that we could make a script that sends "welcome to the server!" if its their first time joining the server.

on join:
	if all offline players doesn't contains player:
		send "Welcome to the server!"

This triggers when a player joins, checks if offline players contains player (offline players is a list of all players who have joined your server), and if it doesn't sends "Welcome to the server!"

 



If you would like to see more of these (The Next: Variables) leave a like or a comment! 👍. Have a nice day.

 
  • Like 2

Minecraft Ranks
[DEFAULT] - 9th October 2020
[PRO] - 21st November 2020
[PATRON] - 27th October 2021

Proficiency
Python - 8 Years
C/C++ - 5 Years
Skript - 4 Years
Javascript - 3 Year
Java - 1 Year

Links
Discord - kegnh#1234

 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...