1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved How to make an event when a variable hits a certain number?

Discussion in 'Skript' started by cobalt_ink, Aug 17, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. cobalt_ink

    cobalt_ink Member

    Joined:
    Jul 1, 2021
    Messages:
    2
    Likes Received:
    0
    So, I've looked around for a solid bit, and have found absolutely nothing about this. I'm trying to make a treadmill, and when the player reaches the end of that treadmill, it teleports them to the back of it, and adds 1 to the counter. Then, once that counter reaches 15, it gives 20 seconds of speed to the player, so it eventually stacks up. Here is the current skript:

    ```
    on walk over mossy cobblestone slab:
    if player's yaw is between 1 and 400:
    set {_loc} to the location 2 meters west of the player
    teleport player to {_loc}
    add 1 to {treadmill.%player%}

    if {treadmill.%player%} reaches 15:
    execute console command "/effect give %player% speed 1 20"
    ```
     
  2. Best Answer:
    Post #2 by xdh, Aug 17, 2021
  3. xdh

    xdh Member

    Joined:
    Apr 15, 2020
    Messages:
    46
    Likes Received:
    2
    this is actually pretty simple

    Code (Text):
    1. if {treadmill.%player%} = 15:
     
    • Winner Winner x 1
  4. cobalt_ink

    cobalt_ink Member

    Joined:
    Jul 1, 2021
    Messages:
    2
    Likes Received:
    0
    Thank you, I didn't know it was this simple.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...