Move location in a straight line

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

Status
Not open for further replies.

TadaFireworks

Member
Jun 11, 2020
3
0
0
28
I have the following code, that i expect to move 10 blocks and every step create a particle effect. The thing is, that it doesn't do that, resetting it's rotation after the first step.

command /test:
trigger:
set {location} to location of player
loop 10 times:
set {location} to block 1 in front of {location}
play ender signal at {location}


How could i fix it?
 
Hey TadaFireworks,

The following code should work and is also more efficient:

Code:
command /test:
  trigger:
    set {location} to block 10 in front of player
    play ender signal at {location}

If you get an error let me know.

Hope this helps!
 
Hey TadaFireworks,

The following code should work and is also more efficient:

Code:
command /test:
  trigger:
    set {location} to block 10 in front of player
    play ender signal at {location}

If you get an error let me know.

Hope this helps!

That's cool and all, but i will have a delay after every iteration and the particle is going to play the whole way. Like a bullet.

I actually figured out how to dhttpso this properly, so if anyone wonders:

command /test:
trigger:
set {location} to head location of player
set {yaw} to yaw of location
set {pitch} to pitch of location
set {rotation} to vector from yaw {yaw} and pitch {pitch}
loop 10 times:
set {location} to {location} ~ {rotation}
play ender signal at {location}
wait 5 ticks

https://pastebin.com/UUqf2i97
 
Status
Not open for further replies.