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.