What does updateticks++, ticks and updateticks do in scriptapi?

Avatar

By 6Sence 6 September 2019 06:30

Member · 256 comments

What does updateticks++, ticks and updateticks do in scriptapi?


Avatar

By soulplexis 6 September 2019 07:06

Donator · 879 comments

It's a bad coding method to limit the rate that things happen or other.. like setting a stopwatch and at some amount of time passed you do something, and then reset the clock to 0 repeat..
Like instead of it executing the code 20x second you can put this to make it once every second
Ticks++;
If(ticks >=20) {
[Something here]
Ticks = 0;
}


Official account of Soulplexis
Script creator, LiquidBounce user
If you want to contact me please do that on Discord
As of 2/23 im going to be inactive due to not having any money, need to sell stuff. sory

Avatar

By michaelpt9 20 September 2019 13:32

Member · 140 comments

using TicksExisted is better tho.


ScriptAPI fucktard.

Avatar

By Aftery 21 September 2019 09:33

Member · 444 comments
michaelpt9 wrote

using TicksExisted is better tho.

Depends.
If you want it to run something precisely after enabling a module, etc... a ticks variable should be used
For example, say I have this code:
if (mc.thePlayer.ticksExisted % 500 == 0) mc.thePlayer.jump();
Say for example you enable your module at tick 501, you'll have to wait 499 ticks for it to happen.
But if you enable it at 499, it gets executed next tick.


Links: Discord / cool website

@Aftery#5051 on Discord