Apply speed when on path blocks - Help

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

    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.

DavidGarrett

New Member
May 28, 2018
5
0
0
Skript Version: 2.0.2
Skript Author: DavidGarrett
Minecraft Version: 1.12.2
---
Full Code:

code_language.skript:
on any movement:
    set {_pathspeed} to block below player
    if {_pathspeed} is grass_path:
        if player doesn't have swiftness:
            apply swiftness without any particles to player for 2 seconds

So the code works. but it only works when I am jumping on the path blocks, and not actually standing on them?

This is my first script so I am just stealing bits and pieces from other code and would really like to understand why it's not working.

Thanks!
 
Last edited:
Skript Version:2.0.2
Skript Author:DavidGarrett
Minecraft Version:1.12.2
---
Full Code:

code_language.skript:
on any movement:
    set {_pathspeed} to block below player
    if {_pathspeed} is grass_path:
        if player doesn't have swiftness:
            apply swiftness without any particles to player for 2 seconds

So the code works. but it only workI when i am jumping on the path blocks, and not actually standing on them?

This is my first skript so i am just stealing bits and pieces from other code and would really like to understand why its not working.
Try using "on walking on grass:"
 
  • Like
Reactions: DavidGarrett
oh Perfect, thank you! Sorry that was stupid.. also anything for standing on path blocks?
Sth like that maybe?
code_language.skript:
on walking on grass_path:
    set {_pathspeed} to block below player
    if player doesn't have swiftness:
        apply swiftness without any particles to player for 2 seconds
        if {_pathspeed} is grass_path:
            #do stuff
 
  • Like
Reactions: DavidGarrett
Sth like that maybe?
code_language.skript:
on walking on grass_path:
    set {_pathspeed} to block below player
    if player doesn't have swiftness:
        apply swiftness without any particles to player for 2 seconds
        if {_pathspeed} is grass_path:
            #do stuff


Alright So here is where I am at.

Code:
on walking on grass_path:
    if player does not have speed:
        apply speed without any particles to the player for 2 seconds
on join:
    wait 1 tick
    while player is alive:
        set {_b} to block below player
        if {_b} is grass_path:
            apply speed without any particles to the player for 2 seconds

I am receiving the correct effect when walking on path blocks, it will give me speed for 2 seconds as long as I don't have it, but as soon as I stop the effect will wear off. and I will have to move to another block to receive the effect again. I am looking to have speed 1 while being on a path block in any sort of way, but as soon as I am no longer on them for the effect to be removed. almost suggesting players build with paths for faster travel.

Is this the correct way to go about this?

Thanks!!
 
Alright So here is where I am at.

Code:
on walking on grass_path:
    if player does not have speed:
        apply speed without any particles to the player for 2 seconds
on join:
    wait 1 tick
    while player is alive:
        set {_b} to block below player
        if {_b} is grass_path:
            apply speed without any particles to the player for 2 seconds

I am receiving the correct effect when walking on path blocks, it will give me speed for 2 seconds as long as I don't have it, but as soon as I stop the effect will wear off. and I will have to move to another block to receive the effect again. I am looking to have speed 1 while being on a path block in any sort of way, but as soon as I am no longer on them for the effect to be removed. almost suggesting players build with paths for faster travel.

Is this the correct way to go about this?

Thanks!!
Uhh just saying, always add a wait to a while loop.
 
  • Like
Reactions: DavidGarrett
Something like this
code_language.skript:
on join:
    wait 1 tick
    while player is online:
        set {_b} to block below player
        if {_b} is grass_path:
            apply speed without any particles to the player for 2 seconds
        wait 2 seconds
 
  • Like
Reactions: DavidGarrett
Status
Not open for further replies.