Help with using vectors for particle velocity

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

banduriku

New Member
Apr 15, 2024
5
0
1
26
Hello, I'm new at Skript, and I've been trying to learn how to use vectors.
In this script, I'm trying to get these loop entities to shoot particles toward the player using vector data. Interestingly enough, when I run this script no errors occur but the script does nothing at all, not even damage. If I remove the vector variables completely the script works just fine (sans particles). Is there anything that I'm doing wrong that could cause this?

Here's the code:
Code:
on right click:
    lore of player's tool contains "soul":
        loop all entities in radius 3 around target entity:
            loop-entity is not player:
                set {_start} to location of loop-entity
                set {_end} to location of player
                set {_vector} to vector from {_start} to {_end}
                set {_v2} to normalized {_vector}
                damage loop-entity by 1
                play sound "entity.vex.ambient" at loop-entity
                draw 1 soul at loop-entity with offset {_v2} with extra 1