How for duration = 21 tick?
for duration = 2 tick;
Code:for(int j = 0; j++ < 20;) { NextTick(()=>{ //CODE }); }
NextTick after 21 ticks?
Discussion in 'Rust Development' started by bazuka5801, Jun 25, 2016.
-
Wulf Community Admin
NextTick is not meant to be used as a timer. If you'd like to time something, just use timer.Once or timer.Repeat.
-
ok = how get nexttick callback ?
-
Wulf Community Admin
I'm not sure what you mean by that. -
Code:
bool CountTick = false; int CountedTicks = 0;[ChatCommand("tick")] void cmdTick(...) { CountedTicks = 21 CountTick = true; }void OnTick() { if(CountTick) { CountedTicks--; if(CountedTicks <= 0) { // Your instruction here CountTick = false; COuntedTicks = 0; } } }
