Tutorial by: Xna


Hello! Have you ever thought of making an custom ability but don’t know where to start?

I’ve got you covered, sit tight and make sure to hang on this one!

BEGINNING «««««

This section will cover the basics of making your own ability.

We’ll start with Damage

Damaging the player is the key point of an ability. Without it, you’ll basically be throwing rubber duckies at the player.

Note: use variables to damage others rather then yourself, here are some basic variables you need.

set {_EX1::*} to (all entities in radius of 5) where [input is not player] #Excluding Effects from User

set {_EX2::*} to (all entities in radius of 5) where [input is player] #Including Effects to User

Anyway, where were we? Oh! Damaging effects!
When you execute an ability, it has to do some sort of an effect to your opponents.

ignite {_EX1::*} for 3 seconds
damage {_EX1::*} by 1 [heart/hearts]
poison {_EX1::*} for 5 seconds
make {_EX1::*} take fake damage
strike lighting at {_EX2::*}

Optionally, you can also loop these events so they maybe can look better.

You can also bypass damage cooldown when using the damage effect.

Next is additional effects.

We can use the push ability to deal knock back to an entity to make it look cooler.

push {_EX1::*} upwards at speed 1.1
push {_EX1::*} backwards at speed 0.4

Combining these 2 strings can make the knock back more realistic.

COOLDOWN«««««

Cooldowns are debatably the most important thing have abilities. Without them, players can spam there ability and possibly lag the server.

And they can be abused to there full extent, making it unfair.

So, how DO you add a cooldown? It’s quite easy.

  1. Set a variable
    if difference between now and {%player’s uuid%.LM} is less then 5 seconds:

You can modify the cooldown by changing the value between the variable and now.

If they try to click during a cooldown, you can send them this message.

message "&eWait {%player’s uuid%.LM} before you can use this ability again!" to player

Once the cooldown is finished, you can do put an else statement and put the following ability.

else:
    # code

After you put your code, MAKE SURE to set the variable to now after the ability is finished.

set {%player’s uuid%.LM} to now

If you followed my Instructions, you should have something close to this.

on right click holding stick:
  name of player's tool is "Test":
    if difference between now and {%player's uuid%.LM} is less than 5 seconds:
        message "&eWait {%player’s uuid%.LM} before you can use this ability again!” to player
    else:
        # code
        set {%player’s uuid%.LM} to now

Feel free to try this example out in your server.

Anyway, on to effects.

EFFECTS«««««

When you use an ability, you don’t want it to look bland. You want it to look cool and amazing.

You can use particles to help with that, they are the 1 of the key elements to making an ability look awesome.

Here is how you can use them.

on right click holding stick:
  name of player's tool is "Test":
    if difference between now and {%player's uuid%.LM} is less than 5 seconds:
        message "&eWait {%player’s uuid%.LM} before you can use this ability again!” to player
    else:
        loop 360 times:
            set {_v} to spherical vector with radius 2, yaw loop-value, pitch 0
            play 1 of composter at location of player ~ {_v}

        heal player
        set {%player’s uuid%.LM} to now

This plays a circle at there feet when they use the ability and heals them!

OPTIONAL«««««

Metadata is useful for setting custom values or some cool effect on an entity, let’s say an arrow.

Metadata will be cleared after a server restart, or skript reload. So it’s best that you use it on temporary entities like armor stands, arrows, ender pearls, and more!

on shoot:
    if player’s held item is named "&cHaven Bow":
        set metadata value "H" to last spawned arrow to true
        if event-entity has metadata value "H":
            send "&aYou shot an arrow!" to shooter

Thats all for now, post a comment to suggest or give feedback!


Did you find Xna's tutorial helpful?


You must be logged in to comment

  • Jan. 9, 2022, 3:59 p.m. - The_Commander64  

    i recomend changing the variable {%player's uuid%.LM} to being {LM::%player's uuid%}.

    it makes variables wayy cleaner and easier to reset

    |     
  • April 28, 2022, 5:23 p.m. - ButterflyBullets  

    Great tutorial! But I would try to make somethings more understandable for beginners since some of it is a bit more complex for people just starting out with Skript. I understand it well, but not all may. :D

    |     
  • May 1, 2022, 9:04 a.m. - JuraJPlayer  

    Hey, great tutorial. But i am not sure, if you can use "last spawned" when the projectile is shot. It should be "last shot arrow" or "last shot projectile"

    |     
  • April 30, 2023, 6:42 p.m. - KWAKZ  

    "if difference between now and {%player’s uuid%.LM} is less then 5 seconds:"
    needs to be using "than"

    |     
  • April 15, 2024, 1:59 p.m. - Nenemchocolito  

    I loved your tutorial, but I haven't learnt most of the things you put on it!

    |