Solved Custom speed for sandstone slab or sandstone

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

aescraft

Well-Known Member
Mar 1, 2017
295
13
0
In my server, we use sandstone and sandstone slab as roads.
I want to use the "on step on sandstone" to give bonus walk speed.

The problem is, I don't know how to revert it to the normal speed when the player left the sandstone slab road.
Anyone know how to do it?

code_language.skript:
on step on sandstone slab:
  if player has permission "skript.vip":
    set the player's walk speed to 0.5

Thanks.
 
Normal speed: 0.2
Sneaking speed: 0.1

So that should work for you:
code_language.skript:
on step on sandstone slab:
    if player has permission "skript.vip":
        while block at location 2 blocks below player is sandstone slab:
            set the player's walk speed to 0.5
            wait 4 ticks
        set the player's walk speed to 0.2
 
Normal speed: 0.2
Sneaking speed: 0.1

So that should work for you:
code_language.skript:
on step on sandstone slab:
    if player has permission "skript.vip":
        while block at location 2 blocks below player is sandstone slab:
            set the player's walk speed to 0.5
            wait 4 ticks
        set the player's walk speed to 0.2
Just now I got the time to try it out, and its not working. The speed is changing from fast to slow really fast.
 
Just now I got the time to try it out, and its not working. The speed is changing from fast to slow really fast.
code_language.skript:
on step on sandstone slab:
    if player has permission "skript.vip":
    set the player's walk speed to 0.5
        while block at location 2 blocks below player is sandstone slab:
            wait 1 tick
        set the player's walk speed to 0.2

Indentation is messed up, mark as solved and close thread pls :emoji_slight_smile:
 
code_language.skript:
on step on sandstone slab:
    if player has permission "skript.vip":
    set the player's walk speed to 0.5
        while block at location 2 blocks below player is sandstone slab:
            wait 1 tick
        set the player's walk speed to 0.2

Indentation is messed up, mark as solved and close thread pls :emoji_slight_smile:
I think this will still have the same issue.
The game will be "fighting" against itself
It will set the speed for 0.5, and 1 tick later to 0.2
and again to 0.5 and later 0.2.

This is the issue I was having, I don't know how your code would fix it.
 
I think this will still have the same issue.
The game will be "fighting" against itself
It will set the speed for 0.5, and 1 tick later to 0.2
and again to 0.5 and later 0.2.

This is the issue I was having, I don't know how your code would fix it.
Works on my server m8
 
This is what worked for me:

code_language.skript:
on step on sandstone slab:
  if lore of player's boot is "Via":
    set the player's walk speed to 0.5
    wait 0.1 second
    if block at location 2 blocks below player is sandstone slab:
      stop
    set the player's walk speed to 0.2
 
Status
Not open for further replies.