[Question] How to wait some seconds
-
I was wondering, like, when module is enabled then i want to wait some seconds i tried some solutions but they're not working, can anybody help?
Something like this:
mc.thePlayer.MotionY = 1; (wait some seconds) mc.thePlayer.MotionY = 0;
-
@arabian
Here are some examples, each one is good for different use case.onEnable: mc.thePlayer.motionY = 1; timeout(1000, function () { mc.thePlayer.motionY = 0 }); onUpdate: if (timer.hasTimePassed(1000)) { timer.reset(); mc.thePlayer.motionY = 0; } timer = new MSTimer(); onEnable: ticks = 0 onUpdate: ticks++ if (ticks > 20) { mc.thePlayer.motionY = 0 }
(timeout and MSTimer aren't imported without Core)
You should just look at some scripts to see how to delay code.
-
@czechhek thank you