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

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

cobalt_ink

Member
Jul 1, 2021
2
0
1
26
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"
```
 
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"
```
this is actually pretty simple

Code:
if {treadmill.%player%} = 15:
 
Status
Not open for further replies.