This is another of the most frequently asked questions, and before anyone else makes a guide on this, here it is: this is how you make a counter increase or decrease every second! Let’s get started!
Using a Repeater To Decrease
This is pretty simple. First of all, you can either activate the repeater in many different ways: using a relay that listens for game start, a zone that starts it whenever a player enters the zone, or maybe just manually through channels! Let’s do just manually, like a teleporter.
Use a zone wired to a teleporter.
Player enters zone < teleport player here
Then, place down a repeater. You can start the repeater using channels or wires. For example, if you’re not a big fan of wasting memory on wires, use the channels. If you hate feeling mixed up with channels, use wires. Here are the ways to do that:
Wires
Wire the teleporter to the repeater.
Player teleported here < start repeater
Now for the task part. Change the repeater’s task interval
to 1 second. And just below, set how long the repeater will count. For example, I’ll make it run for 30 seconds.
Time for the magic! Now, place down a counter. Don’t worry; these devices aren’t intimidating. As soon as you open the settings, it should say starting value
Put how many seconds you want it to start from. (This has to be the same amount as the same task interval!)
Now, it’s time for the decreasing part. Use wires.
Wires
Wire the repeater to the counter.
Repeater runs task < decrement counter
(Decrement means decrease/subtract)
Now it should work! Now to increase!
Using a Repeater To Increase
This is pretty simple and a little different from the other way. First, keep everything, wires and all. You will only have to change the settings of the devices.
First, in the counter, set the wire instead of decrement counter
to increment counter
.
Then, set the counter’s starting value
to 0.
Now you’re done! It will now increase every second!
Extras
- If you want it to stop a certain number, go to the Target section and set the target value to whatever you want; now it stops at this number!
- Now if you want it only to go to the target value and stop, deactivate the zone when the player is either teleported, the target value is reached, or anything else!
- Use this for counting and other functions!
- Watch out for repeaters—they are not the best devices and cost a good amount of memory, especially block code. (Advanced tip)
Thanks for reading! Hopefully this helped!
GUIDE CREATOR DISCLAIMER
You don’t have to do something like this; if you get the general idea, that is fine. Any ideas or suggestions are to be announced or are mentioned in this guide. This is also not the only way, as there are other ways. This, in my opinion, is the easiest, but that is biased. Thanks. Buh-bye.